Class: BigDoor::Leaderboard

Inherits:
Resource
  • Object
show all
Defined in:
lib/big_door/leaderboard.rb

Overview

This module provides Leaderboard Resource object corresponding to /leaderboard BigDoor API end point

Instance Method Summary collapse

Methods inherited from Resource

all, #delete, #end_point, end_point, end_point_from_classname, #get_id, #instance_to_payload, #load, #response_to_instance, #save

Constructor Details

#initialize(hash = {}) ⇒ Leaderboard

Initialize new Leaderboard object with optional Hash

Parameters:

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

    Optional fields to assign to object



13
14
15
16
17
18
19
# File 'lib/big_door/leaderboard.rb', line 13

def initialize( hash = {} ) 
    $log.debug( "Leaderboard init with hash = #{hash.inspect}")
    default_values = { }
    default_values.merge!( hash )
    $log.debug( "Leaderboard default_values = #{default_values.inspect}")
    super( default_values )
end

Instance Method Details

#execute(params, client) ⇒ Object

Executes Leaderboard retrieval

@param [Hash] params
  request params

@param [BigDoor::Client] client
  Initialized BigDoor::Client object

@return [Array] array of Hashes representing Leaderboard


31
32
33
34
35
36
37
38
39
40
# File 'lib/big_door/leaderboard.rb', line 31

def execute( params, client )
    $log.debug('execute leaderboard');

    uri = sprintf '%s/execute', end_point

    $log.debug( sprintf 'execute uri = %s', uri )
    result = client.get( uri , params )
    $log.debug(sprintf 'result = %s', result.inspect );
    result
end