class ZombieBattleground::Api::Models::Card
Validator for Card
Attributes
@!attribute [r] ability the Cards's ability
@return [String]
@example
card.ability #=> ""
@api public
@!attribute [r] block_height
the Cards's block_height
@return [Integer]
@example
card.block_height #=> 0
@api public
@!attribute [r] cost the Cards's cost
@return [Integer]
@example
card.cost #=> 1
@api public
@!attribute [r] damage the Cards's damage
@return [Integer]
@example
card.damage #=> 1
@api public
@!attribute [r] description the Cards's description
@return [String]
@example
card.description #=> "<b>Attack:</b> +1 damage to Water zombies"
@api public
@!attribute [r] flavor_text
the Cards's flavor_text
@return [String]
@example
card.flavor_text #=> "The unfriendly ghost..."
@api public
@!attribute [r] frame the Cards's frame
@return [String]
@example
card.frame #=> ""
@api public
@!attribute [r] health the Cards's health
@return [Integer]
@example
card.health #=> 1
@api public
@!attribute [r] id the Cards's id
@return [Integer]
@example
card.id #=> 1
@api public
@!attribute [r] kind the Cards's kind
@return [String]
@example
card.kind #=> "CREATURE"
@api public
@!attribute [r] name the Cards's name
@return [String]
@example
card.name #=> "Whizpar"
@api public
@!attribute [r] picture the Cards's picture
@return [String]
@example
card.picture #=> "Whizpar"
@api public
@!attribute [r] rank the Cards's rank
@return [String]
@example
card.rank #=> "MINION"
@api public
@!attribute [r] rarity the Cards's rarity
@return [String]
@example
card.rarity #=> ""
@api public
@!attribute [r] set the Cards's set
@return [String]
@example
card.set #=> "AIR"
@api public
@!attribute [r] type the Cards's type
@return [String]
@example
card.type #=> "WALKER"
@api public
@!attribute [r] version the Cards's version
@return [String]
@example
card.version #=> "v3"
@api public
Public Class Methods
Creates a new Card
@param card [Hash] Parsed JSON response
@return [ZombieBattleground::Api::Card]
@example
card = ZombieBattleground::Api::Card.new(parsed_json) # => ZombieBattleground::Api::Card
@api public
# File lib/zombie_battleground/api/models/card.rb, line 276 def initialize(card) card.each do |key, value| next if value.nil? # this is an illegal response, card id 1 is bogus instance_variable_set("@#{key}".to_sym, value) end end