Class: ZombieBattleground::Api::Responses::GetMatchResponse

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations, ResponseHelper, ValidationHelper
Defined in:
lib/zombie_battleground/api/responses/get_match_response.rb

Overview

Response validator for GetMatch

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ZombieBattleground::Api::GetMatchResponse

Creates a new GetMatchResponse

Examples:

response = ZombieBattleground::Api::GetMatchResponse.new(faraday_response)
# => ZombieBattleground::Api::GetMatchResponse

Parameters:

  • response (Faraday::Response)

    Faraday response from endpoint



46
47
48
49
50
# File 'lib/zombie_battleground/api/responses/get_match_response.rb', line 46

def initialize(response)
  handle_errors(response)

  @match = ZombieBattleground::Api::Models::Match.new(JSON.parse(response.body))
end

Instance Attribute Details

#matchZombieBattleground::Api::Models::Match (readonly)

the match

Examples:

response.match #=> ZombieBattleground::Api::Models::Match

Returns:



30
31
32
# File 'lib/zombie_battleground/api/responses/get_match_response.rb', line 30

def match
  @match
end