Class: NumbersAndWords::Wrappers::Float
- Inherits:
-
Object
- Object
- NumbersAndWords::Wrappers::Float
- Defined in:
- lib/numbers_and_words/wrappers/float.rb
Constant Summary collapse
- ZERO_SYMBOL =
'0'
Instance Attribute Summary collapse
-
#number ⇒ Object
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(number) ⇒ Float
constructor
A new instance of Float.
- #to_words(options = {}) ⇒ Object
Constructor Details
#initialize(number) ⇒ Float
Returns a new instance of Float.
10 11 12 |
# File 'lib/numbers_and_words/wrappers/float.rb', line 10 def initialize(number) @number = number end |
Instance Attribute Details
#number ⇒ Object
Returns the value of attribute number.
8 9 10 |
# File 'lib/numbers_and_words/wrappers/float.rb', line 8 def number @number end |
Instance Method Details
#to_words(options = {}) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/numbers_and_words/wrappers/float.rb', line 14 def to_words( = {}) @options = words = [] words << integral_part_with() words << fractional_part_with() unless fractional_part_is_nil? NumbersAndWords::WordsArray.new(words).join end |