Class: Legion::Gaia::RunnerHost
- Inherits:
-
Object
- Object
- Legion::Gaia::RunnerHost
show all
- Includes:
- Logging::Helper
- Defined in:
- lib/legion/gaia/runner_host.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(runner_module) ⇒ RunnerHost
Returns a new instance of RunnerHost.
12
13
14
15
16
|
# File 'lib/legion/gaia/runner_host.rb', line 12
def initialize(runner_module)
@runner_module = runner_module
extend runner_module if runner_module.is_a?(Module) && !runner_module.is_a?(Class)
log.debug("RunnerHost initialized runner_module=#{runner_module}")
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name) ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/legion/gaia/runner_host.rb', line 18
def method_missing(method_name, ...)
return @runner_module.public_send(method_name, ...) if @runner_module.respond_to?(method_name)
instance = runner_instance
return instance.public_send(method_name, ...) if instance.respond_to?(method_name)
super
end
|
Instance Attribute Details
#last_tick_result ⇒ Object
Returns the value of attribute last_tick_result.
10
11
12
|
# File 'lib/legion/gaia/runner_host.rb', line 10
def last_tick_result
@last_tick_result
end
|
Instance Method Details
#inspect ⇒ Object
38
39
40
|
# File 'lib/legion/gaia/runner_host.rb', line 38
def inspect
"#<#{self.class} module=#{@runner_module}>"
end
|
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
27
28
29
30
31
32
|
# File 'lib/legion/gaia/runner_host.rb', line 27
def respond_to_missing?(method_name, include_private = false)
return true if @runner_module.respond_to?(method_name, include_private)
return true if @runner_module.is_a?(Class) && @runner_module.method_defined?(method_name)
super
end
|
#to_s ⇒ Object
34
35
36
|
# File 'lib/legion/gaia/runner_host.rb', line 34
def to_s
"RunnerHost(#{@runner_module})"
end
|