Module: DHS::Proxy::Problems

Extended by:
ActiveSupport::Concern
Defined in:
lib/dhs/concerns/proxy/problems.rb

Instance Method Summary collapse

Instance Method Details

#errorsObject



18
19
20
21
# File 'lib/dhs/concerns/proxy/problems.rb', line 18

def errors
  response = (_raw.present? && _raw.is_a?(Hash) && _raw[:field_errors]) ? OpenStruct.new(body: _raw.to_json) : nil
  @errors ||= DHS::Problems::Errors.new(response, record)
end

#initialize(data) ⇒ Object



14
15
16
# File 'lib/dhs/concerns/proxy/problems.rb', line 14

def initialize(data)
  super(data)
end

#warningsObject



23
24
25
# File 'lib/dhs/concerns/proxy/problems.rb', line 23

def warnings
  @warnings ||= DHS::Problems::Warnings.new(_raw, record)
end