Class: NumberHumanizer::Languages::Base
- Inherits:
-
Object
- Object
- NumberHumanizer::Languages::Base
- Defined in:
- lib/number_humanizer/languages/base.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(number, **args) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(number, **args) ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 10 |
# File 'lib/number_humanizer/languages/base.rb', line 5 def initialize(number, **args) @number = number @real_part, @fraction_part = exctract_real_and_fraction_parts @currency = args[:currency] || NumberHumanizer.currency @sub_currency = args[:sub_currency] || NumberHumanizer.sub_currency end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
3 4 5 |
# File 'lib/number_humanizer/languages/base.rb', line 3 def result @result end |
Instance Method Details
#call ⇒ Object
12 13 14 15 |
# File 'lib/number_humanizer/languages/base.rb', line 12 def call @result = process_result self end |