Class: Deckstrings::Card

Inherits:
Object
  • Object
show all
Defined in:
lib/deckstrings/deckstrings.rb

Overview

A Hearthstone card with basic metadata.

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name, cost) ⇒ Card

Returns a new instance of Card


248
249
250
251
252
# File 'lib/deckstrings/deckstrings.rb', line 248

def initialize(id, name, cost)
  @id = id
  @name = name
  @cost = cost
end

Instance Attribute Details

#costInteger (readonly)

Returns Mana cost of the card.

Returns:

  • (Integer)

    Mana cost of the card.


262
263
264
# File 'lib/deckstrings/deckstrings.rb', line 262

def cost
  @cost
end

#idInteger (readonly)

Returns Hearthstone DBF ID of the card.

Returns:

  • (Integer)

    Hearthstone DBF ID of the card.

See Also:


256
257
258
# File 'lib/deckstrings/deckstrings.rb', line 256

def id
  @id
end

#nameString (readonly)

Returns Name of the card.

Returns:

  • (String)

    Name of the card.


259
260
261
# File 'lib/deckstrings/deckstrings.rb', line 259

def name
  @name
end