Class: NexusParser::Tokens::Number
- Defined in:
- lib/nexus_parser/tokens.rb
Instance Attribute Summary
Attributes inherited from Token
Instance Method Summary collapse
-
#initialize(str) ⇒ Number
constructor
A new instance of Number.
Constructor Details
#initialize(str) ⇒ Number
Returns a new instance of Number.
215 216 217 218 219 220 221 222 223 224 |
# File 'lib/nexus_parser/tokens.rb', line 215 def initialize(str) # a little oddness here, in some case we don't want to include the .0 # see issues with numbers as labels if str =~ /\./ @value = str.to_f else @value = str.to_i end end |