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.


20
21
22
23
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 20

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


25
26
27
28
29
30
31
32
33
34
35
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 25

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

#optionsObject

Returns the value of attribute options


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

def options
  @options
end

#strategyObject

Returns the value of attribute strategy


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

def strategy
  @strategy
end

Instance Method Details

#respond_to_missing?(method_name, include_private: false) ⇒ Boolean

Returns:

  • (Boolean)

37
38
39
# File 'lib/numbers_and_words/strategies/figures_converter/options.rb', line 37

def respond_to_missing?(method_name, include_private: false)
  Object.const_get(proxy_class_name(method_name)) || super
end