Class: Codebreaker::ValidatableEntity
- Inherits:
-
Object
- Object
- Codebreaker::ValidatableEntity
- Includes:
- Validator
- Defined in:
- lib/app/entities/validatable_entity.rb
Instance Method Summary collapse
-
#initialize ⇒ ValidatableEntity
constructor
A new instance of ValidatableEntity.
- #valid? ⇒ Boolean
- #validate ⇒ Object
Methods included from Validator
#check_cover?, #check_include?, #check_numbers?, #check_size?
Constructor Details
#initialize ⇒ ValidatableEntity
Returns a new instance of ValidatableEntity.
7 8 9 |
# File 'lib/app/entities/validatable_entity.rb', line 7 def initialize @errors = [] end |
Instance Method Details
#valid? ⇒ Boolean
15 16 17 18 |
# File 'lib/app/entities/validatable_entity.rb', line 15 def valid? validate @errors.empty? end |
#validate ⇒ Object
11 12 13 |
# File 'lib/app/entities/validatable_entity.rb', line 11 def validate raise NotImplementedError end |