Sha256: 12fbffb117bc9c6c4afda63a3a32786008c26eec20f46db8c10a17dfa0c4451c
Contents?: true
Size: 971 Bytes
Versions: 10
Compression:
Stored size: 971 Bytes
Contents
module CloudSesame module Query module AST class Value < Abstract::Value TYPES = { string: StringValue, numeric: NumericValue, datetime: DateValue } def self.map_type(symbol) (klass =TYPES[symbol]) ? klass : self end def self.parse(value) return value.parse self if value.kind_of?(RangeValue) ( range_value?(value) ? RangeValue : numeric_value?(value) ? NumericValue : datetime_value?(value) ? DateValue : StringValue ).new(value, self) end def self.range_value?(value) range?(value) || string_range?(value) end def self.numeric_value?(value) numeric?(value) || string_numeric?(value) end def self.datetime_value?(value) datetime?(value) || string_datetime?(value) || string_time?(value) end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems