Class: Oso::Polar::Data::Filter::Condition
- Inherits:
-
Struct
- Object
- Struct
- Oso::Polar::Data::Filter::Condition
- Defined in:
- lib/oso/polar/data/filter.rb
Instance Attribute Summary collapse
-
#cmp ⇒ Object
Returns the value of attribute cmp.
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
Class Method Summary collapse
Instance Attribute Details
#cmp ⇒ Object
Returns the value of attribute cmp
38 39 40 |
# File 'lib/oso/polar/data/filter.rb', line 38 def cmp @cmp end |
#left ⇒ Object
Returns the value of attribute left
38 39 40 |
# File 'lib/oso/polar/data/filter.rb', line 38 def left @left end |
#right ⇒ Object
Returns the value of attribute right
38 39 40 |
# File 'lib/oso/polar/data/filter.rb', line 38 def right @right end |
Class Method Details
.parse(polar, left, cmp, right) ⇒ Object
39 40 41 |
# File 'lib/oso/polar/data/filter.rb', line 39 def self.parse(polar, left, cmp, right) Condition.new(parse_side(polar, left), cmp, parse_side(polar, right)) end |
.parse_side(polar, side) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/oso/polar/data/filter.rb', line 43 def self.parse_side(polar, side) key = side.keys.first val = side[key] case key when 'Field' Projection.new(polar.name_to_class(val[0]), val[1]) when 'Immediate' polar.host.to_ruby('value' => [[val.keys.first, val.values.first]]) else raise key end end |