Module: ThorInstanceVariableHook
- Defined in:
- lib/whatup/cli/thor_interactive.rb
Overview
Allows us to use variables passed into a Thor class’s config[:locals] Allows us to call the variables passed into config[:locals] as methods in our cli classes
Instance Method Summary collapse
- #method_missing(method, *args, &block) ⇒ Object
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/whatup/cli/thor_interactive.rb', line 9 def method_missing method, *args, &block var = instance_variable_get(:@_initializer).last[:locals][method] return var unless var.nil? super end |
Instance Method Details
#respond_to_missing?(name, include_private = false) ⇒ Boolean
16 17 18 |
# File 'lib/whatup/cli/thor_interactive.rb', line 16 def respond_to_missing? name, include_private = false super end |