Module: EacCli::Runner::InstanceMethods
- Defined in:
- lib/eac_cli/runner/instance_methods.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
36
37
38
39
40
|
# File 'lib/eac_cli/runner/instance_methods.rb', line 36
def method_missing(method, *args, &block)
return super unless runner_context.respond_to_call?(method)
runner_context.call(method, *args, &block)
end
|
Instance Method Details
24
25
26
|
# File 'lib/eac_cli/runner/instance_methods.rb', line 24
def parsed
@parsed ||= ::EacCli::Parser.new(self.class.runner_definition, runner_context.argv).parsed
end
|
#program_name ⇒ Object
28
29
30
|
# File 'lib/eac_cli/runner/instance_methods.rb', line 28
def program_name
runner_context.if_present(&:program_name) || $PROGRAM_NAME
end
|
#respond_to_missing?(method, include_all = false) ⇒ Boolean
32
33
34
|
# File 'lib/eac_cli/runner/instance_methods.rb', line 32
def respond_to_missing?(method, include_all = false)
runner_context.respond_to_call?(method) || super
end
|
6
7
8
9
10
11
|
# File 'lib/eac_cli/runner/instance_methods.rb', line 6
def run_run
parsed
run_callbacks(:run) { run }
rescue ::EacCli::Runner::Exit
end
|
#runner_context ⇒ Object
13
14
15
16
17
|
# File 'lib/eac_cli/runner/instance_methods.rb', line 13
def runner_context
return @runner_context if @runner_context
raise 'Context was required, but was not set yet'
end
|
#runner_context=(new_runner_context) ⇒ Object
19
20
21
22
|
# File 'lib/eac_cli/runner/instance_methods.rb', line 19
def runner_context=(new_runner_context)
@runner_context = new_runner_context
@parsed = nil
end
|