Class: Zodra::ParamsParser::Result
- Inherits:
-
Object
- Object
- Zodra::ParamsParser::Result
- Defined in:
- lib/zodra/params_parser.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params:, errors:) ⇒ Result
constructor
A new instance of Result.
- #invalid? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(params:, errors:) ⇒ Result
Returns a new instance of Result.
8 9 10 11 |
# File 'lib/zodra/params_parser.rb', line 8 def initialize(params:, errors:) @params = params.freeze @errors = errors.freeze end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/zodra/params_parser.rb', line 6 def errors @errors end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/zodra/params_parser.rb', line 6 def params @params end |
Instance Method Details
#invalid? ⇒ Boolean
17 18 19 |
# File 'lib/zodra/params_parser.rb', line 17 def invalid? !valid? end |
#valid? ⇒ Boolean
13 14 15 |
# File 'lib/zodra/params_parser.rb', line 13 def valid? errors.empty? end |