Class: Gamemaker::CardGame::Card
- Inherits:
-
Object
- Object
- Gamemaker::CardGame::Card
- Defined in:
- lib/gamemaker/card_game/card.rb
Direct Known Subclasses
Class Method Summary collapse
-
.all ⇒ Object
This method should return an array of all possible Cards.
-
.from_json(json) ⇒ Object
Deserialize the (parsed)
jsondata into a Card object.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks if this Card is equal to the
otherCard. -
#as_json ⇒ Object
Retrun a JSON-serializable representation of this Card.
-
#initialize ⇒ Card
constructor
A new instance of Card.
Constructor Details
#initialize ⇒ Card
Returns a new instance of Card.
14 15 16 17 18 |
# File 'lib/gamemaker/card_game/card.rb', line 14 def initialize if self.class == Card raise NotImplementedError, "Card is an abstract class" end end |
Class Method Details
.all ⇒ Object
This method should return an array of all possible Cards
5 6 7 |
# File 'lib/gamemaker/card_game/card.rb', line 5 def self.all raise NotImplementedError end |
.from_json(json) ⇒ Object
Deserialize the (parsed) json data into a Card object
10 11 12 |
# File 'lib/gamemaker/card_game/card.rb', line 10 def self.from_json(json) raise NotImplementedError end |
Instance Method Details
#==(other) ⇒ Object
Checks if this Card is equal to the other Card
21 22 23 |
# File 'lib/gamemaker/card_game/card.rb', line 21 def ==(other) raise NotImplementedError end |
#as_json ⇒ Object
Retrun a JSON-serializable representation of this Card
26 27 28 |
# File 'lib/gamemaker/card_game/card.rb', line 26 def as_json(*) raise NotImplementedError end |