Sha256: 95340237bcb2cb6510b42c982150913303bc3402f646be0a413698f69fa36890

Contents?: true

Size: 511 Bytes

Versions: 28

Compression:

Stored size: 511 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

28 entries across 28 versions & 1 rubygems

Version Path
lhs-15.3.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.3.1.pre.fixlhc.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.3.0 lib/lhs/concerns/proxy/problems.rb
lhs-15.2.5 lib/lhs/concerns/proxy/problems.rb
lhs-15.2.4 lib/lhs/concerns/proxy/problems.rb
lhs-15.2.3 lib/lhs/concerns/proxy/problems.rb
lhs-15.2.3.pre.favorites.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.2.2.pre.favorites.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.2.2 lib/lhs/concerns/proxy/problems.rb
lhs-15.2.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.2.0 lib/lhs/concerns/proxy/problems.rb
lhs-15.1.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.1.0 lib/lhs/concerns/proxy/problems.rb
lhs-15.0.2 lib/lhs/concerns/proxy/problems.rb
lhs-15.0.1 lib/lhs/concerns/proxy/problems.rb
lhs-15.0.0 lib/lhs/concerns/proxy/problems.rb
lhs-14.6.5 lib/lhs/concerns/proxy/problems.rb
lhs-14.6.4 lib/lhs/concerns/proxy/problems.rb
lhs-14.6.3 lib/lhs/concerns/proxy/problems.rb
lhs-14.6.2 lib/lhs/concerns/proxy/problems.rb