Class: NumbersAndWords::Strategies::FiguresConverter::Languages::Base
- Inherits:
-
Object
- Object
- NumbersAndWords::Strategies::FiguresConverter::Languages::Base
- Includes:
- Families::Base
- Defined in:
- lib/numbers_and_words/strategies/figures_converter/languages/base.rb
Instance Attribute Summary collapse
-
#figures ⇒ Object
Returns the value of attribute figures.
-
#options ⇒ Object
Returns the value of attribute options.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
-
#strings ⇒ Object
Returns the value of attribute strings.
-
#translations ⇒ Object
Returns the value of attribute translations.
Attributes included from Families::Base
#current_capacity, #parent_figures
Instance Method Summary collapse
-
#initialize(strategy) ⇒ Base
constructor
A new instance of Base.
- #print_words ⇒ Object
- #words ⇒ Object
Methods included from Families::Base
#capacity_iteration, #complex_number_to_words, #complex_tens, #hundreds_number_to_words, #save_parent_figures, #simple_number_to_words, #strings_logic, #words_in_capacity
Methods included from Families::Helpers
Constructor Details
#initialize(strategy) ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 15 |
# File 'lib/numbers_and_words/strategies/figures_converter/languages/base.rb', line 10 def initialize strategy @strategy = strategy @figures = strategy.figures @translations = strategy.translations @options = strategy. end |
Instance Attribute Details
#figures ⇒ Object
Returns the value of attribute figures.
8 9 10 |
# File 'lib/numbers_and_words/strategies/figures_converter/languages/base.rb', line 8 def figures @figures end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/numbers_and_words/strategies/figures_converter/languages/base.rb', line 8 def @options end |
#strategy ⇒ Object
Returns the value of attribute strategy.
8 9 10 |
# File 'lib/numbers_and_words/strategies/figures_converter/languages/base.rb', line 8 def strategy @strategy end |
#strings ⇒ Object
Returns the value of attribute strings.
8 9 10 |
# File 'lib/numbers_and_words/strategies/figures_converter/languages/base.rb', line 8 def strings @strings end |
#translations ⇒ Object
Returns the value of attribute translations.
8 9 10 |
# File 'lib/numbers_and_words/strategies/figures_converter/languages/base.rb', line 8 def translations @translations end |
Instance Method Details
#print_words ⇒ Object
22 23 24 |
# File 'lib/numbers_and_words/strategies/figures_converter/languages/base.rb', line 22 def print_words @strings.reverse.join ' ' end |
#words ⇒ Object
17 18 19 20 |
# File 'lib/numbers_and_words/strategies/figures_converter/languages/base.rb', line 17 def words @strings = strings_logic @strings.empty? && zero || print_words end |