Module: HandInformation
- Included in:
- Hand
- Defined in:
- tomes/components/deck_builder/hand_information.rb
Overview
Provides some methods for obtaining information about a hand.
Instance Method Summary collapse
-
#empty? ⇒ Boolean
Checks if #cards is empty.
-
#full?(threshold = 1) ⇒ Boolean
Checks if the number of cards meets or exceeds a given threshold.
-
#include?(this) ⇒ Boolean
Checks if #cards includes the provided Card.
-
#length ⇒ Integer
Returns the length of #cards.
Instance Method Details
#empty? ⇒ Boolean
Checks if #cards is empty.
13 14 15 |
# File 'tomes/components/deck_builder/hand_information.rb', line 13 def empty? cards.empty? end |
#full?(threshold = 1) ⇒ Boolean
Checks if the number of cards meets or exceeds a given threshold.
27 28 29 |
# File 'tomes/components/deck_builder/hand_information.rb', line 27 def full?(threshold = 1) length >= threshold end |
#include?(this) ⇒ Boolean
Checks if #cards includes the provided Card.
20 21 22 |
# File 'tomes/components/deck_builder/hand_information.rb', line 20 def include?(this) cards.include?(this) end |
#length ⇒ Integer
Returns the length of #cards.
7 8 9 |
# File 'tomes/components/deck_builder/hand_information.rb', line 7 def length cards.length end |