Class: CodebreakerVk::CheckErrors

Inherits:
ValidatingData show all
Defined in:
lib/codebreaker_vk/check_errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ValidatingData

#valid?

Methods included from Validate

#check_cover?, #check_include?, #check_numbers?, #check_size?

Constructor Details

#initialize(input) ⇒ CheckErrors

Returns a new instance of CheckErrors.



7
8
9
10
# File 'lib/codebreaker_vk/check_errors.rb', line 7

def initialize(input)
  super()
  @input = input
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



5
6
7
# File 'lib/codebreaker_vk/check_errors.rb', line 5

def errors
  @errors
end

#inputObject (readonly)

Returns the value of attribute input.



5
6
7
# File 'lib/codebreaker_vk/check_errors.rb', line 5

def input
  @input
end

Instance Method Details

#validateObject



12
13
14
# File 'lib/codebreaker_vk/check_errors.rb', line 12

def validate
  @errors << I18n.t('invalid.include_error') unless check_include?(@input, Console::COMMANDS.values)
end