Class: NumbersAndWords::Strategies::FiguresConverter::Options::Proxy
- Inherits:
-
Object
- Object
- NumbersAndWords::Strategies::FiguresConverter::Options::Proxy
- Defined in:
- lib/numbers_and_words/strategies/figures_converter/options.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
Instance Method Summary collapse
-
#initialize(strategy, options) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(method_name, *args, &block) ⇒ Object
- #respond_to_missing?(method_name, include_private: false) ⇒ Boolean
Constructor Details
#initialize(strategy, options) ⇒ Proxy
Returns a new instance of Proxy.
22 23 24 25 |
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 22 def initialize(strategy, ) @strategy = strategy @options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 27 def method_missing(method_name, *args, &block) method = Object.const_get(proxy_class_name(method_name)) if method method.new(self, args, block) else super end rescue NameError nil end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
20 21 22 |
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 20 def @options end |
#strategy ⇒ Object
Returns the value of attribute strategy.
20 21 22 |
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 20 def strategy @strategy end |
Instance Method Details
#respond_to_missing?(method_name, include_private: false) ⇒ Boolean
39 40 41 |
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 39 def respond_to_missing?(method_name, include_private: false) Object.const_get(proxy_class_name(method_name)) || super end |