Class: CodebreakerVk::GameProcess
- Inherits:
-
ValidatingData
- Object
- ValidatingData
- CodebreakerVk::GameProcess
- Defined in:
- lib/codebreaker_vk/game_process.rb
Constant Summary collapse
- HINT =
'hint'
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
Instance Method Summary collapse
- #as_array_of_numbers ⇒ Object
- #hint? ⇒ Boolean
-
#initialize(input) ⇒ GameProcess
constructor
A new instance of GameProcess.
- #validate ⇒ Object
Methods inherited from ValidatingData
Methods included from Validate
#check_cover?, #check_include?, #check_numbers?, #check_size?
Constructor Details
#initialize(input) ⇒ GameProcess
Returns a new instance of GameProcess.
11 12 13 14 |
# File 'lib/codebreaker_vk/game_process.rb', line 11 def initialize(input) super() @input = input end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
7 8 9 |
# File 'lib/codebreaker_vk/game_process.rb', line 7 def errors @errors end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
7 8 9 |
# File 'lib/codebreaker_vk/game_process.rb', line 7 def input @input end |
Instance Method Details
#as_array_of_numbers ⇒ Object
23 24 25 |
# File 'lib/codebreaker_vk/game_process.rb', line 23 def as_array_of_numbers @as_array_of_numbers ||= @input.chars.map(&:to_i) end |
#hint? ⇒ Boolean
27 28 29 |
# File 'lib/codebreaker_vk/game_process.rb', line 27 def hint? @input == HINT end |