class ZombieBattleground::Api::Models::Card

Validator for Card

Attributes

ability[R]

@!attribute [r] ability the Cards's ability

@return [String]

@example

card.ability #=> ""

@api public

block_height[R]

@!attribute [r] block_height the Cards's block_height

@return [Integer]

@example

card.block_height #=> 0

@api public

cost[R]

@!attribute [r] cost the Cards's cost

@return [Integer]

@example

card.cost #=> 1

@api public

damage[R]

@!attribute [r] damage the Cards's damage

@return [Integer]

@example

card.damage #=> 1

@api public

description[R]

@!attribute [r] description the Cards's description

@return [String]

@example

card.description #=> "<b>Attack:</b> +1 damage to Water zombies"

@api public

flavor_text[R]

@!attribute [r] flavor_text the Cards's flavor_text

@return [String]

@example

card.flavor_text #=> "The unfriendly ghost..."

@api public

frame[R]

@!attribute [r] frame the Cards's frame

@return [String]

@example

card.frame #=> ""

@api public

health[R]

@!attribute [r] health the Cards's health

@return [Integer]

@example

card.health #=> 1

@api public

id[R]

@!attribute [r] id the Cards's id

@return [Integer]

@example

card.id #=> 1

@api public

image_url[R]

@!attribute [r] image_url the Cards's image_url

@return [String]

@example

card.image_url #=> "https://loom.games/img/cards/001.png"

@api public

kind[R]

@!attribute [r] kind the Cards's kind

@return [String]

@example

card.kind #=> "CREATURE"

@api public

mould_id[R]

@!attribute [r] mould_id the Cards's mould_id

@return [String]

@example

card.mould_id #=> "1"

@api public

name[R]

@!attribute [r] name the Cards's name

@return [String]

@example

card.name #=> "Whizpar"

@api public

picture[R]

@!attribute [r] picture the Cards's picture

@return [String]

@example

card.picture #=> "Whizpar"

@api public

rank[R]

@!attribute [r] rank the Cards's rank

@return [String]

@example

card.rank #=> "MINION"

@api public

rarity[R]

@!attribute [r] rarity the Cards's rarity

@return [String]

@example

card.rarity #=> ""

@api public

set[R]

@!attribute [r] set the Cards's set

@return [String]

@example

card.set #=> "AIR"

@api public

type[R]

@!attribute [r] type the Cards's type

@return [String]

@example

card.type #=> "WALKER"

@api public

version[R]

@!attribute [r] version the Cards's version

@return [String]

@example

card.version #=> "v3"

@api public

Public Class Methods

new(card) click to toggle source

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