Class: Foursquare::Merchant::Campaigns
- Inherits:
-
Base
- Object
- Base
- Foursquare::Merchant::Campaigns
show all
- Defined in:
- lib/foursquare/campaigns.rb
Constant Summary
Constants included
from Requests
Requests::API, Requests::OAUTH
Instance Attribute Summary
Attributes inherited from Base
#consumer
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Methods included from Requests
#get, #post
Instance Method Details
#add(params) ⇒ Object
12
13
14
15
|
# File 'lib/foursquare/campaigns.rb', line 12
def add(params)
response = self.post("/add", params)
Foursquare::Merchant::Campaign.new(response['campaign'], @consumer)
end
|
#find(campaign_id, params = {}) ⇒ Object
7
8
9
10
|
# File 'lib/foursquare/campaigns.rb', line 7
def find(campaign_id, params={})
response = self.get("/#{campaign_id}", params)
Foursquare::Merchant::Campaign.new(response['campaign'], @consumer)
end
|
#list(params = {}) ⇒ Object
17
18
19
20
21
|
# File 'lib/foursquare/campaigns.rb', line 17
def list(params={})
response = self.get("/list", params)
campaigns = response['campaigns']['items']
campaigns.map { |item| Foursquare::Merchant::Campaign.new(item, @consumer) }
end
|