Class: MODL::Parser::Parsed::ParsedNumber
- Inherits:
-
Object
- Object
- MODL::Parser::Parsed::ParsedNumber
- Defined in:
- lib/modl/parser/parsed.rb
Overview
Class to represent a parsed grammar object
Instance Attribute Summary collapse
-
#num ⇒ Object
Returns the value of attribute num.
Instance Method Summary collapse
-
#initialize(string) ⇒ ParsedNumber
constructor
A new instance of ParsedNumber.
Constructor Details
#initialize(string) ⇒ ParsedNumber
719 720 721 |
# File 'lib/modl/parser/parsed.rb', line 719 def initialize(string) @num = string.include?('.') ? string.to_f : string.to_i end |
Instance Attribute Details
#num ⇒ Object
Returns the value of attribute num.
717 718 719 |
# File 'lib/modl/parser/parsed.rb', line 717 def num @num end |