Class: FlurryHarvest::Feed

Inherits:
Object
  • Object
show all
Defined in:
lib/flurry_harvest/feed.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Feed

Returns a new instance of Feed.



4
5
6
7
8
9
# File 'lib/flurry_harvest/feed.rb', line 4

def initialize(data)
  flurry_offers = data["recommendation"] ? data["recommendation"] : []
  flurry_offers = [flurry_offers] if flurry_offers.is_a? Hash

  @offers = flurry_offers.map{ |r| FlurryHarvest::Offer.new(r) }
end

Instance Attribute Details

#offersObject (readonly)

Returns the value of attribute offers.



2
3
4
# File 'lib/flurry_harvest/feed.rb', line 2

def offers
  @offers
end