Class: Gamemaker::CardGame::Card

Inherits:
Object
  • Object
show all
Defined in:
lib/gamemaker/card_game/card.rb

Direct Known Subclasses

PlayingCard

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCard

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

.allObject

This method should return an array of all possible Cards

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/gamemaker/card_game/card.rb', line 21

def ==(other)
  raise NotImplementedError
end

#as_jsonObject

Retrun a JSON-serializable representation of this Card

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/gamemaker/card_game/card.rb', line 26

def as_json(*)
  raise NotImplementedError
end