Module: NitroApi::SiteCalls

Included in:
NitroApi
Defined in:
lib/nitro_api/site_calls.rb

Instance Method Summary collapse

Instance Method Details

#make_points_leaders_call(opts) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/nitro_api/site_calls.rb', line 3

def make_points_leaders_call opts
  opts = symbolize_keys opts
  params = {
      :method => 'site.getPointsLeaders'
  }

  # Only include the session key when it is present. This is to make batch
  # calls work for this method.
  params[:sessionKey] = @session if @session

  opts_list = {
      criteria: 'criteria',
      point_category: 'pointCategory',
      return_count: 'returnCount',
      start: 'start',
      duration: 'duration',
      user_ids: 'userIds',
      tags: 'tags',
      tags_operator: 'tagsOperator',
      group_name: 'groupName',
      with_rank: 'withRank',
      with_surrounding_users: 'withSurroundingUsers',
      preferences: 'preferences'
  }

  opts.each do |key,value|
    params[opts_list[key]] = value if opts_list.has_key?(key)
  end
  make_call(params, :get)
end