Class: DsaCodebreakerGame::Code
- Inherits:
-
Array
- Object
- Array
- DsaCodebreakerGame::Code
- Defined in:
- lib/dsa_codebreaker_game/code.rb
Constant Summary collapse
- COLORS =
Available colours red®, orange (O), yellow (Y), green (G), blue (B), Indigo (I), and violet (V).
['R', 'O', 'Y', 'G', 'B', 'I', 'V']
Instance Method Summary collapse
-
#initialize ⇒ Code
constructor
A new instance of Code.
- #randomizer ⇒ Object
Constructor Details
#initialize ⇒ Code
Returns a new instance of Code.
8 9 10 11 12 |
# File 'lib/dsa_codebreaker_game/code.rb', line 8 def initialize 4.times do self << randomizer end end |
Instance Method Details
#randomizer ⇒ Object
14 15 16 |
# File 'lib/dsa_codebreaker_game/code.rb', line 14 def randomizer COLORS[rand(0..6)] end |