module Strutta # Entries belong to a Strutta::Games object # Instance methods found in Strutta::APIObject class Entries < APIObject # Initializes the Strutta::Entries object # # @param id [Integer, nil] Entry id # @param game [Strutta::Games] Master Strutta::Games object # @return [Strutta::Entries] instantiated Strutta::Entries object def initialize(id = nil, game) @id = id @game = game @root_path = "entries/#{@id}" @no_id_error = Errors::ENTRY_ID_REQUIRED end # GET transition history for Entry (no ID required) # games/:game_id/entries/:id/transitions # # @return [Hash] Parsed body of the API response def transitions(params = {}) @game.verify_id(@id, Errors::ENTRY_ID_REQUIRED) @game.get(params, "entries/#{@id}/transitions") end # GET leaderboard history for Entries in Points Rounds (no ID required) # games/:game_id/entries/leaderboard # # @return [Hash] Parsed body of the API response def leaderboard(params = {}) @game.verify_no_id(@id) @game.get(params, 'entries/leaderboard') end # GET on-demand winners from pool of active Entries (no ID required) # games/:game_id/entries/on-demand-winners # # @return [Hash] Parsed body of the API response def on_demand_winners(params = {}) @game.verify_no_id(@id) @game.get(params, 'entries/on-demand-winners') end end end