Class: GrouponDeals

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

Class Method Summary collapse

Class Method Details

.evaluate(linq_exp) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/providers/groupon/groupon_provider.rb', line 8

def self.evaluate(linq_exp)
  Groupon.api_key = '966a0273f2974c725e25d507d4e07daabcb0ee00'
  evaluator = GrouponExpressionEvaluator.new(linq_exp)
  linq_exp.where.visit(evaluator)
  selected_values = Groupon.deals(evaluator.conditions)
  #puts evaluator.conditions.inspect
  selected_values.collect do |e|
    Object.send(:define_method,linq_exp.variable.to_sym) { e }
    linq_exp.select.visit(EnumerableExpessionEvaluator.new(linq_exp))
  end
end

.linqr_providerObject



5
6
7
# File 'lib/providers/groupon/groupon_provider.rb', line 5

def self.linqr_provider
 self
end