Class: Adcloud::Topic

Inherits:
Entity
  • Object
show all
Defined in:
lib/adcloud/topic.rb

Constant Summary

Constants inherited from Entity

Entity::MAX_PER_PAGE

Instance Attribute Summary

Attributes inherited from Entity

#errors

Instance Method Summary collapse

Methods inherited from Entity

all, all!, api_name, #connection, #create, create, #destroy, find, find_by_name, #meta, #update

Instance Method Details

#discounts=(data) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/adcloud/topic.rb', line 10

def discounts=(data)
  @discounts = data.reduce({}) do |hash, raw_discount|
    discount = TopicDiscount.new(raw_discount)
    hash[discount.country_code] = discount
    hash
  end
end