Module: Checkdin::Leaderboard

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

Instance Method Summary collapse

Instance Method Details

#campaign_leaderboard(campaign_id, options = {}) ⇒ Object

Get the leading point accounts for a single campaign’sc specific points.

param [Integer] campaign_id The ID of the campaign to fetch the leaderboard for.

Parameters:

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

Options Hash (options):

  • Integer (Object)

    :limit - The maximum number of records to return.



22
23
24
25
26
27
# File 'lib/checkdin/leaderboard.rb', line 22

def campaign_leaderboard(campaign_id, options={})
  response = connection.get do |req|
    req.url "campaigns/#{campaign_id}/leaderboard"
  end
  return_error_or_body(response)
end

#classification_leaderboard(campaign_id) ⇒ Object

Get the classification leaderboard for a given campaign

param [Integer] campaign_id The ID of the campaign to fetch the leaderboard for.



33
34
35
36
37
38
# File 'lib/checkdin/leaderboard.rb', line 33

def classification_leaderboard(campaign_id)
  response = connection.get do |req|
    req.url "campaigns/#{campaign_id}/classification_leaderboard"
  end
  return_error_or_body(response)
end

#leaderboard(options = {}) ⇒ Object

Get the leading point accounts for non-campaign-specific points.

Parameters:

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

Options Hash (options):

  • Integer (Object)

    :limit - The maximum number of records to return.



9
10
11
12
13
14
# File 'lib/checkdin/leaderboard.rb', line 9

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