Module: Checkdin::Promotions

Included in:
Client
Defined in:
lib/checkdin/promotions.rb

Instance Method Summary collapse

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

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • Integer (Object)

    :limit - The maximum number of records to return.

  • Integer (Object)

    :page - The page of results to return.



34
35
36
37
38
39
# File 'lib/checkdin/promotions.rb', line 34

def promotion_votes_leaderboard(id, options={})
  response = connection.get do |req|
    req.url "promotions/#{id}/votes_leaderboard", options
  end
  return_error_or_body(response)
end

#promotions(options = {}) ⇒ Object

Get a list of all promotions for the authenticating client.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • Integer (Object)

    :campaign_id - Only return promotions for this campaign.

  • String (Object)

    :active - Return either active or inactive promotions, use true or false value.

  • Integer (Object)

    :limit - The maximum number of records to return.



20
21
22
23
24
25
# File 'lib/checkdin/promotions.rb', line 20

def promotions(options={})
  response = connection.get do |req|
    req.url "promotions", options
  end
  return_error_or_body(response)
end