Class: CenterWithConstants

Inherits:
Cards show all
Includes:
FromHash, Selectable
Defined in:
lib/ascension/cards.rb

Instance Attribute Summary collapse

Attributes inherited from Cards

#side

Instance Method Summary collapse

Methods included from Selectable

#can?, #engageable_cards

Methods inherited from Cards

#<<, #[], #[]=, #banish, #clear!, #each, #empty?, #first, #get_one, #hydrate!, #include?, #index, #pop, #shuffle!, #to_s_cards

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &b) ⇒ Object



182
183
184
# File 'lib/ascension/cards.rb', line 182

def method_missing(sym,*args,&b)
  game.center.send(sym,*args,&b)
end

Instance Attribute Details

#gameObject

Returns the value of attribute game.



166
167
168
# File 'lib/ascension/cards.rb', line 166

def game
  @game
end

Instance Method Details

#cardsObject



172
173
174
# File 'lib/ascension/cards.rb', line 172

def cards
  game.center.cards + constant_cards
end

#remove(card) ⇒ Object



178
179
180
181
# File 'lib/ascension/cards.rb', line 178

def remove(card)
  return nil if constant_cards.map { |x| x.name }.include?(card.name)
  game.center.remove(card)
end

#sizeObject



175
176
177
# File 'lib/ascension/cards.rb', line 175

def size
  cards.size
end