Module: Rack::Params::Result
- Defined in:
- lib/rack/params/result.rb
Overview
a mixin for validation results, to include errors
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
Instance Method Summary collapse
-
#invalid? ⇒ Boolean
is the result invalid, meaning it has some errors?.
-
#valid? ⇒ Boolean
is the result valid, meaning it has no errors?.
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors
6 7 8 |
# File 'lib/rack/params/result.rb', line 6 def errors @errors end |
Instance Method Details
#invalid? ⇒ Boolean
is the result invalid, meaning it has some errors?
14 15 16 |
# File 'lib/rack/params/result.rb', line 14 def invalid? not valid? end |
#valid? ⇒ Boolean
is the result valid, meaning it has no errors?
9 10 11 |
# File 'lib/rack/params/result.rb', line 9 def valid? errors.length == 0 end |