Class: NumbersAndWords::Wrappers::Float
- Inherits:
-
Object
- Object
- NumbersAndWords::Wrappers::Float
- Defined in:
- lib/numbers_and_words/wrappers/float.rb
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.
6 7 8 |
# File 'lib/numbers_and_words/wrappers/float.rb', line 6 def initialize number @number = number end |
Instance Attribute Details
#number ⇒ Object
Returns the value of attribute number.
4 5 6 |
# File 'lib/numbers_and_words/wrappers/float.rb', line 4 def number @number end |
Instance Method Details
#to_words(options = {}) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/numbers_and_words/wrappers/float.rb', line 10 def to_words = {} words = [] words << integral_part_with() words << fractional_part_with() unless fractional_part_is_nil? NumbersAndWords::WordsArray.new(words).join end |