Class: Mastermind::Colors
- Inherits:
-
Object
- Object
- Mastermind::Colors
- Defined in:
- lib/mastermind/GameRules.rb
Instance Method Summary collapse
-
#initialize(colors = []) ⇒ Colors
constructor
A new instance of Colors.
- #valid_colors ⇒ Object
Constructor Details
#initialize(colors = []) ⇒ Colors
Returns a new instance of Colors.
61 62 63 64 65 66 67 |
# File 'lib/mastermind/GameRules.rb', line 61 def initialize(colors = []) if(colors.empty? || colors.size != 6) @colors = DEFAULT_COLORS else @colors = colors end end |
Instance Method Details
#valid_colors ⇒ Object
69 70 71 |
# File 'lib/mastermind/GameRules.rb', line 69 def valid_colors @colors end |