Class: FilterParam::AST::Literals::Integer
- Inherits:
-
FilterParam::AST::Literal
- Object
- Node
- FilterParam::AST::Literal
- FilterParam::AST::Literals::Integer
- Defined in:
- lib/filter_param/ast/literals/integer.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from FilterParam::AST::Literal
Instance Method Summary collapse
- #data_type ⇒ Object
-
#initialize(value) ⇒ Integer
constructor
A new instance of Integer.
Methods inherited from FilterParam::AST::Literal
Methods inherited from Node
Constructor Details
#initialize(value) ⇒ Integer
Returns a new instance of Integer.
5 6 7 8 9 10 11 |
# File 'lib/filter_param/ast/literals/integer.rb', line 5 def initialize(value) whole_num = value.to_s.split(".").first @value = Integer(whole_num) rescue ArgumentError raise InvalidLiteral.new("Invalid Integer: #{value}") end |
Instance Method Details
#data_type ⇒ Object
13 14 15 |
# File 'lib/filter_param/ast/literals/integer.rb', line 13 def data_type :integer end |