Class: CardGame::Trump

Inherits:
BaseCard show all
Defined in:
lib/cardgame/card.rb

Instance Attribute Summary collapse

Attributes inherited from BaseCard

#rank

Instance Method Summary collapse

Methods inherited from BaseCard

#initialize

Constructor Details

This class inherits a constructor from CardGame::BaseCard

Instance Attribute Details

#suitObject

When playing a trump card, the player can set which suit it has so that the next player has to follow it



20
21
22
# File 'lib/cardgame/card.rb', line 20

def suit
  @suit
end

Instance Method Details

#to_sObject



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

def to_s
  "#{super} requiring #{@suit}"
end

#trump?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/cardgame/card.rb', line 22

def trump?
  true
end