Class: GrouponExpressionEvaluator

Inherits:
ExpressionEvaluator show all
Defined in:
lib/providers/groupon/groupon_provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ExpressionEvaluator

#visit_arg, #visit_float, #visit_integer, #visit_statements, #visit_string, #visit_stringcontent, #visit_symbol, #visit_unary, #visit_variable

Constructor Details

#initialize(linq_exp) ⇒ GrouponExpressionEvaluator

Returns a new instance of GrouponExpressionEvaluator.



24
25
26
27
# File 'lib/providers/groupon/groupon_provider.rb', line 24

def initialize(linq_exp)
  @conditions = {}
  super
end

Instance Attribute Details

#conditionsObject (readonly)

Returns the value of attribute conditions.



23
24
25
# File 'lib/providers/groupon/groupon_provider.rb', line 23

def conditions
  @conditions
end

Instance Method Details

#visit_binary(node) ⇒ Object



29
30
31
32
33
# File 'lib/providers/groupon/groupon_provider.rb', line 29

def visit_binary(node)
  right_val = node.right.visit(self)
  left_val = node.left.visit(self)
  @conditions[left_val] = right_val
end

#visit_call(node) ⇒ Object



36
37
38
# File 'lib/providers/groupon/groupon_provider.rb', line 36

def visit_call(node)
  node.identifier.to_s.to_sym
end