Class: Beecart::Validators::BaseValidator
- Inherits:
-
Object
- Object
- Beecart::Validators::BaseValidator
- Includes:
- Beecart::Validator
- Defined in:
- lib/beecart/validators/base_validator.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
-
#initialize ⇒ BaseValidator
constructor
A new instance of BaseValidator.
-
#run(args) ⇒ Boolean
Run the validation for given data.
Methods included from Beecart::Validator
Constructor Details
#initialize ⇒ BaseValidator
Returns a new instance of BaseValidator.
11 12 13 14 15 |
# File 'lib/beecart/validators/base_validator.rb', line 11 def initialize @valid = true @target_data = nil @errors = {} end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
9 10 11 |
# File 'lib/beecart/validators/base_validator.rb', line 9 def error @error end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
9 10 11 |
# File 'lib/beecart/validators/base_validator.rb', line 9 def @messages end |
Instance Method Details
#run(args) ⇒ Boolean
Run the validation for given data
21 22 23 24 |
# File 'lib/beecart/validators/base_validator.rb', line 21 def run args @target_data = args @valid end |