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.



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

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.



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

def decorator
  @decorator
end

#figuresObject

Returns the value of attribute figures.



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

def figures
  @figures
end

#languageObject

Returns the value of attribute language.



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

def language
  @language
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

#translationsObject

Returns the value of attribute translations.



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

def translations
  @translations
end

Instance Method Details

#runObject



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

def run
  around { language.words }
end