Sha256: e4641cf6eeb13c9aea68122c8d25eea86dc6dd7cda3e23c53d5d3748e2368039

Contents?: true

Size: 513 Bytes

Versions: 19

Compression:

Stored size: 513 Bytes

Contents

require 'active_support'

class LHS::Proxy

  module Problems
    extend ActiveSupport::Concern

    included do
      attr_writer :errors, :warnings
    end

    def initialize(data)
      super(data)
    end

    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

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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
lhs-16.1.5 lib/lhs/concerns/proxy/problems.rb
lhs-16.1.4 lib/lhs/concerns/proxy/problems.rb
lhs-16.1.3 lib/lhs/concerns/proxy/problems.rb
lhs-16.1.2 lib/lhs/concerns/proxy/problems.rb
lhs-16.1.1 lib/lhs/concerns/proxy/problems.rb
lhs-16.1.0 lib/lhs/concerns/proxy/problems.rb
lhs-16.0.1 lib/lhs/concerns/proxy/problems.rb
lhs-16.0.0 lib/lhs/concerns/proxy/problems.rb
lhs-15.7.0 lib/lhs/concerns/proxy/problems.rb
lhs-15.6.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.6.0 lib/lhs/concerns/proxy/problems.rb
lhs-15.5.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.5.0 lib/lhs/concerns/proxy/problems.rb
lhs-15.4.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.4.0 lib/lhs/concerns/proxy/problems.rb
lhs-15.4.0.pre.hasone.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.3.3 lib/lhs/concerns/proxy/problems.rb
lhs-15.3.3.pre.fixoptions.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.3.2 lib/lhs/concerns/proxy/problems.rb