Module: LHS::Proxy::Problems

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

Instance Method Summary collapse

Instance Method Details

#errorsObject



16
17
18
19
# File 'lib/lhs/concerns/proxy/problems.rb', line 16

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



12
13
14
# File 'lib/lhs/concerns/proxy/problems.rb', line 12

def initialize(data)
  super(data)
end

#warningsObject



21
22
23
# File 'lib/lhs/concerns/proxy/problems.rb', line 21

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