Class: FlurryHarvest::Offer

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

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Offer

Returns a new instance of Offer.



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/flurry_harvest/offer.rb', line 2

def initialize(data)
  super

  self.icon = data["@appIconUrl"]
  self.time_to_payout = nil
  self.title = data["@appName"]
  self.required_actions = "Download and Start"
  self.link = data["@actionUrl"]
  self.price = data["@appPrice"].to_f / 100
  self.provider = "Flurry"
  self.credits = nil
  self.id = get_id
end

Instance Method Details

#get_idObject



16
17
18
# File 'lib/flurry_harvest/offer.rb', line 16

def get_id
  Digest::MD5.hexdigest("#{title}-#{icon}")
end