Class: Zodra::ParamsParser::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/zodra/params_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorsObject (readonly)

Returns the value of attribute errors.



6
7
8
# File 'lib/zodra/params_parser.rb', line 6

def errors
  @errors
end

#paramsObject (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

Returns:



17
18
19
# File 'lib/zodra/params_parser.rb', line 17

def invalid?
  !valid?
end

#valid?Boolean

Returns:



13
14
15
# File 'lib/zodra/params_parser.rb', line 13

def valid?
  errors.empty?
end