Class: ZombieBattleground::Api::Responses::GetCardResponse
- Inherits:
-
Object
- Object
- ZombieBattleground::Api::Responses::GetCardResponse
- Includes:
- ActiveModel::Validations, ResponseHelper, ValidationHelper
- Defined in:
- lib/zombie_battleground/api/responses/get_card_response.rb
Overview
Response validator for GetCard
Instance Attribute Summary collapse
-
#card ⇒ ZombieBattleground::Api::Deck
readonly
the card.
Instance Method Summary collapse
-
#initialize(response) ⇒ ZombieBattleground::Api::GetCardResponse
constructor
Creates a new GetCardResponse.
Constructor Details
#initialize(response) ⇒ ZombieBattleground::Api::GetCardResponse
Creates a new GetCardResponse
48 49 50 51 52 |
# File 'lib/zombie_battleground/api/responses/get_card_response.rb', line 48 def initialize(response) handle_errors(response) @card = ZombieBattleground::Api::Models::Card.new(JSON.parse(response.body)) end |
Instance Attribute Details
#card ⇒ ZombieBattleground::Api::Deck (readonly)
the card
32 33 34 |
# File 'lib/zombie_battleground/api/responses/get_card_response.rb', line 32 def card @card end |