Class: NumbersInWords::ToNumber

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
FractionParsing
Defined in:
lib/numbers_in_words/parsing/to_number.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FractionParsing

#fraction, #possible_fraction?, #strip_punctuation, #text, #text_including_punctuation

Constructor Details

#initialize(that, only_compress) ⇒ ToNumber

Returns a new instance of ToNumber.



14
15
16
17
# File 'lib/numbers_in_words/parsing/to_number.rb', line 14

def initialize(that, only_compress)
  @that = that
  @only_compress = only_compress
end

Instance Attribute Details

#only_compressObject (readonly)

Returns the value of attribute only_compress.



12
13
14
# File 'lib/numbers_in_words/parsing/to_number.rb', line 12

def only_compress
  @only_compress
end

#thatObject (readonly)

Returns the value of attribute that.



12
13
14
# File 'lib/numbers_in_words/parsing/to_number.rb', line 12

def that
  @that
end

Instance Method Details

#callObject



19
20
21
# File 'lib/numbers_in_words/parsing/to_number.rb', line 19

def call
  special || decimal || as_numbers
end