Class: Deckstrings::Card
- Inherits:
-
Object
- Object
- Deckstrings::Card
- Defined in:
- lib/deckstrings/deckstrings.rb
Overview
A Hearthstone card with basic metadata.
Instance Attribute Summary collapse
-
#cost ⇒ Integer
readonly
Mana cost of the card.
-
#id ⇒ Integer
readonly
Hearthstone DBF ID of the card.
-
#name ⇒ String
readonly
Name of the card.
Instance Method Summary collapse
-
#initialize(id, name, cost) ⇒ Card
constructor
A new instance of Card.
Constructor Details
#initialize(id, name, cost) ⇒ Card
Returns a new instance of Card.
263 264 265 266 267 |
# File 'lib/deckstrings/deckstrings.rb', line 263 def initialize(id, name, cost) @id = id @name = name @cost = cost end |
Instance Attribute Details
#cost ⇒ Integer (readonly)
Returns Mana cost of the card.
277 278 279 |
# File 'lib/deckstrings/deckstrings.rb', line 277 def cost @cost end |
#id ⇒ Integer (readonly)
Returns Hearthstone DBF ID of the card.
271 272 273 |
# File 'lib/deckstrings/deckstrings.rb', line 271 def id @id end |
#name ⇒ String (readonly)
Returns Name of the card.
274 275 276 |
# File 'lib/deckstrings/deckstrings.rb', line 274 def name @name end |