Class: OboParser::Tokens::Number
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.
133 134 135 136 137 138 139 140 141 142 |
# File 'lib/tokens.rb', line 133 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 |