Class: Strutta::Entries
- Defined in:
- lib/strutta-api/entries.rb
Overview
Entries belong to a Strutta::Games object Instance methods found in Strutta::APIObject
Instance Attribute Summary
Attributes inherited from APIObject
Instance Method Summary collapse
-
#initialize(id = nil, game) ⇒ Strutta::Entries
constructor
Initializes the Strutta::Entries object.
-
#leaderboard(params = {}) ⇒ Hash
GET leaderboard history for Entries in Points Rounds (no ID required) games/:game_id/entries/leaderboard.
-
#transitions(params = {}) ⇒ Hash
GET transition history for Entry (no ID required) games/:game_id/entries/:id/transitions.
Methods inherited from APIObject
#all, #create, #delete, #get, #method_disabled, #update
Constructor Details
#initialize(id = nil, game) ⇒ Strutta::Entries
Initializes the Strutta::Entries object
10 11 12 13 14 15 |
# File 'lib/strutta-api/entries.rb', line 10 def initialize(id = nil, game) @id = id @game = game @root_path = "entries/#{@id}" @no_id_error = Errors::ENTRY_ID_REQUIRED end |
Instance Method Details
#leaderboard(params = {}) ⇒ Hash
GET leaderboard history for Entries in Points Rounds (no ID required) games/:game_id/entries/leaderboard
30 31 32 33 |
# File 'lib/strutta-api/entries.rb', line 30 def leaderboard(params = {}) @game.verify_no_id(@id) @game.get(params, 'entries/leaderboard') end |
#transitions(params = {}) ⇒ Hash
GET transition history for Entry (no ID required) games/:game_id/entries/:id/transitions
21 22 23 24 |
# File 'lib/strutta-api/entries.rb', line 21 def transitions(params = {}) @game.verify_id(@id, Errors::ENTRY_ID_REQUIRED) @game.get(params, "entries/#{@id}/transitions") end |