Class: NumbersAndWords::Strategies::FiguresConverter::Base

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(figures, options = {}) ⇒ Base

Returns a new instance of Base.


13
14
15
16
17
18
19
20
# File 'lib/numbers_and_words/strategies/figures_converter.rb', line 13

def initialize(figures, options = {})
  @figures = figures.reverse

  @decorator = Decorators.factory(self, options)
  @options = Options::Proxy.new(self, options)
  @translations = Translations.factory
  @language = Languages.factory(self)
end

Instance Attribute Details

#decoratorObject

Returns the value of attribute decorator


11
12
13
# File 'lib/numbers_and_words/strategies/figures_converter.rb', line 11

def decorator
  @decorator
end

#figuresObject

Returns the value of attribute figures


11
12
13
# File 'lib/numbers_and_words/strategies/figures_converter.rb', line 11

def figures
  @figures
end

#languageObject

Returns the value of attribute language


11
12
13
# File 'lib/numbers_and_words/strategies/figures_converter.rb', line 11

def language
  @language
end

#optionsObject

Returns the value of attribute options


11
12
13
# File 'lib/numbers_and_words/strategies/figures_converter.rb', line 11

def options
  @options
end

#translationsObject

Returns the value of attribute translations


11
12
13
# File 'lib/numbers_and_words/strategies/figures_converter.rb', line 11

def translations
  @translations
end

Instance Method Details

#runObject


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

def run
  around { language.words }
end