Class: CloudSesame::Query::AST::NumericValue

Inherits:
Abstract::Value show all
Defined in:
lib/cloud_sesame/query/ast/numeric_value.rb

Constant Summary

Constants inherited from Abstract::Value

Abstract::Value::DATETIME_FORMAT, Abstract::Value::DATE_FORMAT, Abstract::Value::DIGIT_FORMAT, Abstract::Value::RANGE_FORMAT, Abstract::Value::TIME_FORMAT

Instance Attribute Summary

Attributes inherited from Abstract::Value

#changed, #compiled, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Abstract::Value

#compile, datetime?, #initialize, numeric?, range?, string_date?, string_datetime?, string_numeric?, string_range?, string_time?

Constructor Details

This class inherits a constructor from CloudSesame::Query::AST::Abstract::Value

Class Method Details

.parse(value) ⇒ Object



6
7
8
# File 'lib/cloud_sesame/query/ast/numeric_value.rb', line 6

def self.parse(value)
  range?(value) || string_range?(value) ? RangeValue.new(value, self) : new(value)
end

Instance Method Details

#==(value) ⇒ Object



14
15
16
# File 'lib/cloud_sesame/query/ast/numeric_value.rb', line 14

def ==(value)
  value == @value.to_f || value == @value || value == compile
end

#to_sObject



10
11
12
# File 'lib/cloud_sesame/query/ast/numeric_value.rb', line 10

def to_s
  compile
end