Module: Checkdin::Activities
- Included in:
- Client
- Defined in:
- lib/checkdin/activities.rb
Instance Method Summary collapse
-
#activities(options = {}) ⇒ Object
Get a list of all activities for the authenticating client.
-
#activity(id) ⇒ Object
Retrieve information about a single activity.
-
#add_vote_on_activity(id, options = {}) ⇒ Object
Add a vote for a single activity when voting is enabled for its promotion.
Instance Method Details
#activities(options = {}) ⇒ Object
Get a list of all activities for the authenticating client.
22 23 24 25 26 27 |
# File 'lib/checkdin/activities.rb', line 22 def activities(={}) response = connection.get do |req| req.url "activities", end return_error_or_body(response) end |
#activity(id) ⇒ Object
Retrieve information about a single activity
param [Integer] id The ID of the activity
8 9 10 11 |
# File 'lib/checkdin/activities.rb', line 8 def activity(id) response = connection.get("activities/#{id}") return_error_or_body(response) end |
#add_vote_on_activity(id, options = {}) ⇒ Object
Add a vote for a single activity when voting is enabled for its promotion
param [Integer] id The ID of the activity
35 36 37 38 39 40 |
# File 'lib/checkdin/activities.rb', line 35 def add_vote_on_activity(id, ={}) response = connection.post do |req| req.url "activities/#{id}/vote", end return_error_or_body(response) end |