Class: Codebreaker::Navigator
- Inherits:
-
ValidatableEntity
- Object
- ValidatableEntity
- Codebreaker::Navigator
- Defined in:
- lib/app/entities/navigator.rb
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
-
#initialize(input) ⇒ Navigator
constructor
A new instance of Navigator.
- #validate ⇒ Object
Methods inherited from ValidatableEntity
Methods included from Validator
#check_cover?, #check_include?, #check_numbers?, #check_size?
Constructor Details
#initialize(input) ⇒ Navigator
Returns a new instance of Navigator.
7 8 9 10 |
# File 'lib/app/entities/navigator.rb', line 7 def initialize(input) super() @input = input end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
5 6 7 |
# File 'lib/app/entities/navigator.rb', line 5 def errors @errors end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
5 6 7 |
# File 'lib/app/entities/navigator.rb', line 5 def input @input end |
Instance Method Details
#validate ⇒ Object
12 13 14 |
# File 'lib/app/entities/navigator.rb', line 12 def validate @errors << I18n.t('invalid.include_error') unless check_include?(@input, Console::COMMANDS.values) end |