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.
222 223 224 225 226 227 228 229 230 231 |
# File 'lib/nexus_parser/tokens.rb', line 222 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 |