Class: NumberHumanizer::Languages::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/number_humanizer/languages/base.rb

Direct Known Subclasses

Arabic, English

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#resultObject (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

#callObject



12
13
14
15
# File 'lib/number_humanizer/languages/base.rb', line 12

def call
  @result = process_result
  self
end