Module: LHS::Proxy::Problems

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

Instance Method Summary collapse

Instance Method Details

#errorsObject


18
19
20
21
# File 'lib/lhs/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 ||= LHS::Problems::Errors.new(response, record)
end

#initialize(data) ⇒ Object


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

def initialize(data)
  super(data)
end

#warningsObject


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

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