Sha256: 69c7f5ae1c5b5a6ce6253ff1ac37c9e822b645637678b07fae82ccfeffd8926a

Contents?: true

Size: 544 Bytes

Versions: 76

Compression:

Stored size: 544 Bytes

Contents

# frozen_string_literal: true

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

76 entries across 76 versions & 1 rubygems

Version Path
lhs-26.2.0 lib/lhs/concerns/proxy/problems.rb
lhs-26.1.0 lib/lhs/concerns/proxy/problems.rb
lhs-26.0.1 lib/lhs/concerns/proxy/problems.rb
lhs-26.0.0 lib/lhs/concerns/proxy/problems.rb
lhs-25.2.0 lib/lhs/concerns/proxy/problems.rb
lhs-25.1.0 lib/lhs/concerns/proxy/problems.rb
lhs-25.0.4 lib/lhs/concerns/proxy/problems.rb
lhs-25.0.3 lib/lhs/concerns/proxy/problems.rb
lhs-25.0.2 lib/lhs/concerns/proxy/problems.rb
lhs-25.0.1 lib/lhs/concerns/proxy/problems.rb
lhs-25.0.0 lib/lhs/concerns/proxy/problems.rb
lhs-24.1.2 lib/lhs/concerns/proxy/problems.rb
lhs-24.1.1 lib/lhs/concerns/proxy/problems.rb
lhs-24.1.0 lib/lhs/concerns/proxy/problems.rb
lhs-24.1.0.pre.2 lib/lhs/concerns/proxy/problems.rb
lhs-24.1.0.pre.1 lib/lhs/concerns/proxy/problems.rb
lhs-24.0.0 lib/lhs/concerns/proxy/problems.rb
lhs-23.0.2 lib/lhs/concerns/proxy/problems.rb
lhs-23.0.1 lib/lhs/concerns/proxy/problems.rb
lhs-23.0.0 lib/lhs/concerns/proxy/problems.rb