Class: FlurryHarvest::Feed
- Inherits:
-
Object
- Object
- FlurryHarvest::Feed
- Defined in:
- lib/flurry_harvest/feed.rb
Instance Attribute Summary collapse
-
#offers ⇒ Object
readonly
Returns the value of attribute offers.
Instance Method Summary collapse
-
#initialize(data) ⇒ Feed
constructor
A new instance of Feed.
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
#offers ⇒ Object (readonly)
Returns the value of attribute offers.
2 3 4 |
# File 'lib/flurry_harvest/feed.rb', line 2 def offers @offers end |