class Strutta::Participants
Participants
belong to a Strutta::Games
object Instance methods found in Strutta::APIObject
Public Class Methods
Initializes the Strutta::Participants
object
@param id [Integer, nil] Entry id @param game [Strutta::Games] Master Strutta::Games
object @return [Strutta::Participants] instantiated Strutta::Participants
object
# File lib/strutta-api/participants.rb, line 10 def initialize(id = nil, game) @id = id @game = game @root_path = "participants/#{@id}" @no_id_error = Errors::PARTICIPANT_ID_REQUIRED end
Public Instance Methods
GET participant permissions games/:game_id/participants/:id/permissions
@return [Hash] Parsed body of the API
response
# File lib/strutta-api/participants.rb, line 40 def permissions(params = {}) participant_id_required @game.get(params, "participants/#{@id}/permissions") end
PATCH participant permissions games/:game_id/participants/:id/permissions
@return [Hash] Parsed body of the API
response
# File lib/strutta-api/participants.rb, line 49 def permissions_update(params = {}) participant_id_required @game.update(params, "participants/#{@id}/permissions") end
GET participant by email address games/:game_id/participants/search
@return [Hash] Parsed body of the API
response
# File lib/strutta-api/participants.rb, line 21 def search(params) fail Errors::InvalidSearchParameters, Errors::INVALID_SEARCH unless params.key? :email @game.verify_no_id(@id) @game.get(params, 'participants/search') end
PATCH update Participant token games/:game_id/participants/:id/token
@return [Hash] Parsed body of the API
response
# File lib/strutta-api/participants.rb, line 31 def token_renew(params = {}) participant_id_required @game.update(params, "participants/#{@id}/token") end
Private Instance Methods
# File lib/strutta-api/participants.rb, line 56 def participant_id_required @game.verify_id(@id, Errors::PARTICIPANT_ID_REQUIRED) end