Class: CodebrekerManfly::ValidatableEntity
- Inherits:
-
Object
- Object
- CodebrekerManfly::ValidatableEntity
- Includes:
- Validator
- Defined in:
- lib/codebreker_manfly/entities/validatable_entity.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize ⇒ ValidatableEntity
constructor
A new instance of ValidatableEntity.
- #valid? ⇒ Boolean
Methods included from Validator
#valid_class?, #valid_non_empty_string?, #valid_non_negative_integer?, #valid_only_numeric_string?, #valid_positive_integer?, #valid_range?, #valid_string_max_length?, #valid_string_min_length?
Constructor Details
#initialize ⇒ ValidatableEntity
Returns a new instance of ValidatableEntity.
9 10 11 |
# File 'lib/codebreker_manfly/entities/validatable_entity.rb', line 9 def initialize @errors = {} end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
7 8 9 |
# File 'lib/codebreker_manfly/entities/validatable_entity.rb', line 7 def errors @errors end |
Instance Method Details
#valid? ⇒ Boolean
13 14 15 16 |
# File 'lib/codebreker_manfly/entities/validatable_entity.rb', line 13 def valid? validate errors.empty? end |