Class: NumbersAndWords::Strategies::FiguresConverter::Options::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/numbers_and_words/strategies/figures_converter/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(strategy, options) ⇒ Proxy

Returns a new instance of Proxy.



17
18
19
20
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 17

def initialize(strategy, options)
  @strategy = strategy
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



22
23
24
25
26
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 22

def method_missing(method_name, *args, &block)
  Object.const_get(proxy_class_name(method_name)).new self, args, block
rescue NameError
  nil
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



15
16
17
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 15

def options
  @options
end

#strategyObject

Returns the value of attribute strategy.



15
16
17
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 15

def strategy
  @strategy
end