Class: ZombieBattleground::Api::Requests::GetMatchesRequest

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations, RequestHelper, ValidationHelper
Defined in:
lib/zombie_battleground/api/requests/get_matches_request.rb

Overview

Request validator for GetMatches

Constant Summary

Constants included from RequestHelper

RequestHelper::BLACKLISTED_INSTANCE_VARIABLES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RequestHelper

#params

Instance Attribute Details

#idInteger

Optionally set the Match’s id for filtered querying

Examples:

request.id #=> 1

Returns:

  • (Integer)


28
29
30
# File 'lib/zombie_battleground/api/requests/get_matches_request.rb', line 28

def id
  @id
end

#limitInteger

Optionally set the limit for max Matches returned

Examples:

request.limit #=> 100

Returns:

  • (Integer)


112
113
114
# File 'lib/zombie_battleground/api/requests/get_matches_request.rb', line 112

def limit
  @limit
end

#pageInteger

Optionally set the page number for filtered querying

Examples:

request.page #=> 1

Returns:

  • (Integer)


100
101
102
# File 'lib/zombie_battleground/api/requests/get_matches_request.rb', line 100

def page
  @page
end

#player1_idString

Optionally set the Match’s player1_id for filtered querying

Examples:

request.player1_id #=> "ZombieSlayer_16601021609396167139295300949176"

Returns:

  • (String)


40
41
42
# File 'lib/zombie_battleground/api/requests/get_matches_request.rb', line 40

def player1_id
  @player1_id
end

#player2_idString

Optionally set the Match’s player2_id for filtered querying

Examples:

request.player2_id #=> "ZombieSlayer_16601021609396167139295300949176"

Returns:

  • (String)


52
53
54
# File 'lib/zombie_battleground/api/requests/get_matches_request.rb', line 52

def player2_id
  @player2_id
end

#statusString

Optionally set the Match’s status for filtered querying

Examples:

request.status #=> "Ended"

Returns:

  • (String)


64
65
66
# File 'lib/zombie_battleground/api/requests/get_matches_request.rb', line 64

def status
  @status
end

#versionString

Optionally set the Match’s version for filtered querying

Examples:

request.version #=> "v3"

Returns:

  • (String)


76
77
78
# File 'lib/zombie_battleground/api/requests/get_matches_request.rb', line 76

def version
  @version
end

#winner_idString

Optionally set the Match’s winner_id for filtered querying

Examples:

request.winner_id #=> "ZombieSlayer_16601021609396167139295300949176"

Returns:

  • (String)


88
89
90
# File 'lib/zombie_battleground/api/requests/get_matches_request.rb', line 88

def winner_id
  @winner_id
end

Instance Method Details

#uriString

The URI for the endpoint

Examples:

request.uri # => "matches"

Returns:

  • (String)


132
133
134
# File 'lib/zombie_battleground/api/requests/get_matches_request.rb', line 132

def uri
  'matches'
end