Module: Checkdin::Promotions
- Included in:
- Client
- Defined in:
- lib/checkdin/promotions.rb
Instance Method Summary collapse
-
#promotion(id) ⇒ Object
Retrieve information about a promotion.
-
#promotion_votes_leaderboard(id, options = {}) ⇒ Object
Get a list of activities for a promotion ordered by the number of votes they have received.
-
#promotions(options = {}) ⇒ Object
Get a list of all promotions for the authenticating client.
Instance Method Details
#promotion(id) ⇒ Object
Retrieve information about a promotion
param [Integer] id The ID of the promotion
8 9 10 11 |
# File 'lib/checkdin/promotions.rb', line 8 def promotion(id) response = connection.get("promotions/#{id}") return_error_or_body(response) end |
#promotion_votes_leaderboard(id, options = {}) ⇒ Object
Get a list of activities for a promotion ordered by the number of votes they have received
param [Integer] id The ID ofthe promotion
34 35 36 37 38 39 |
# File 'lib/checkdin/promotions.rb', line 34 def promotion_votes_leaderboard(id, ={}) response = connection.get do |req| req.url "promotions/#{id}/votes_leaderboard", end return_error_or_body(response) end |
#promotions(options = {}) ⇒ Object
Get a list of all promotions for the authenticating client.
20 21 22 23 24 25 |
# File 'lib/checkdin/promotions.rb', line 20 def promotions(={}) response = connection.get do |req| req.url "promotions", end return_error_or_body(response) end |