Class: RallyUp::Partner::CampaignItem

Inherits:
Object
  • Object
show all
Defined in:
lib/rally_up/partner/campaign_item.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ CampaignItem

Returns a new instance of CampaignItem.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rally_up/partner/campaign_item.rb', line 13

def initialize(json)
  @id = json[:Id]
  @campaign_id = json[:CampaignId]
  @campaign_type = json[:CampaignType]
  @title = json[:Title]
  @type = json[:Type]
  @terminology_singular = json[:TerminologySingular]
  @terminology_plural = json[:TerminologyPlural]
  @thumbnail_url = json[:ThumbnailUrl]
  @price = json[:Price]
  @description = json[:Description]
  @bundle_quantity = json[:BundleQuantity]
  @total_quantity_available = json[:TotalQuantityAvailable]
  @total_sold = json[:TotalSold]
  @available_start_date = json[:AvailableStartDate]
  @availableend_date = json[:AvailableEndDate]
  @availability = json[:Availability]
  @category = json[:Category]
  @associated_prize_id = json[:AssociatedPrizeId]
  @associated_prize_title = json[:AssociatedPrizeTitle]
end

Instance Attribute Details

#associated_prize_idObject

Returns the value of attribute associated_prize_id.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def associated_prize_id
  @associated_prize_id
end

#associated_prize_titleObject

Returns the value of attribute associated_prize_title.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def associated_prize_title
  @associated_prize_title
end

#availabilityObject

Returns the value of attribute availability.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def availability
  @availability
end

#available_start_dateObject

Returns the value of attribute available_start_date.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def available_start_date
  @available_start_date
end

#availableend_dateObject

Returns the value of attribute availableend_date.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def availableend_date
  @availableend_date
end

#bundle_quantityObject

Returns the value of attribute bundle_quantity.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def bundle_quantity
  @bundle_quantity
end

#campaign_idObject

Returns the value of attribute campaign_id.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def campaign_id
  @campaign_id
end

#campaign_typeObject

Returns the value of attribute campaign_type.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def campaign_type
  @campaign_type
end

#categoryObject

Returns the value of attribute category.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def category
  @category
end

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def description
  @description
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def id
  @id
end

#priceObject

Returns the value of attribute price.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def price
  @price
end

#terminology_pluralObject

Returns the value of attribute terminology_plural.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def terminology_plural
  @terminology_plural
end

#terminology_singularObject

Returns the value of attribute terminology_singular.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def terminology_singular
  @terminology_singular
end

#thumbnail_urlObject

Returns the value of attribute thumbnail_url.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def thumbnail_url
  @thumbnail_url
end

#titleObject

Returns the value of attribute title.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def title
  @title
end

#total_quantity_availableObject

Returns the value of attribute total_quantity_available.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def total_quantity_available
  @total_quantity_available
end

#total_soldObject

Returns the value of attribute total_sold.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def total_sold
  @total_sold
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/rally_up/partner/campaign_item.rb', line 6

def type
  @type
end

Class Method Details

.list(campaign_id) ⇒ Object



36
37
38
39
40
41
# File 'lib/rally_up/partner/campaign_item.rb', line 36

def list(campaign_id)
  json = RallyUp::Partner.json(:get, '/v1/partnerapi/campaignitems', params: {
                                 campaignID: campaign_id
                               })
  RallyUp::ListObject.new(json, self)
end