Sha256: baeaeaeee247d3c727485bbfb8cdec1991150bb4d9ad85d99e6b68eb192b41aa

Contents?: true

Size: 581 Bytes

Versions: 76

Compression:

Stored size: 581 Bytes

Contents

# frozen_string_literal: true

module LHS::Problems
  class Warnings < Base

    def initialize(raw, record = nil)
      @raw = raw
      @record = record
      @codes = {}.with_indifferent_access
      @messages = warnings_from_raw
    end

    private

    def warnings_from_raw
      messages = {}
      return messages if !raw.is_a?(Hash) || raw[:field_warnings].blank?
      raw[:field_warnings].each do |field_warning|
        add_error(messages, field_warning[:path].join('.').to_sym, field_warning[:code])
      end
      messages.with_indifferent_access
    end
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
lhs-22.1.1.pre lib/lhs/problems/warnings.rb
lhs-22.1.0 lib/lhs/problems/warnings.rb
lhs-22.0.0 lib/lhs/problems/warnings.rb
lhs-21.3.1 lib/lhs/problems/warnings.rb
lhs-21.3.0 lib/lhs/problems/warnings.rb
lhs-21.3.0.pre.autoauth.1 lib/lhs/problems/warnings.rb
lhs-21.2.4 lib/lhs/problems/warnings.rb
lhs-21.2.3 lib/lhs/problems/warnings.rb
lhs-21.2.3.pre.preload.pre.providers.pre.too.1 lib/lhs/problems/warnings.rb
lhs-21.2.2 lib/lhs/problems/warnings.rb
lhs-21.2.1 lib/lhs/problems/warnings.rb
lhs-21.2.0 lib/lhs/problems/warnings.rb
lhs-21.1.4 lib/lhs/problems/warnings.rb
lhs-21.1.3 lib/lhs/problems/warnings.rb
lhs-21.1.2 lib/lhs/problems/warnings.rb
lhs-21.1.2.pre.keyfix.2 lib/lhs/problems/warnings.rb
lhs-21.1.2.pre.keyfix.1 lib/lhs/problems/warnings.rb
lhs-21.1.2.pre.fix.pre.cant.pre.add.pre.new.pre.key.pre.during.pre.iteration.1 lib/lhs/problems/warnings.rb
lhs-21.1.1.pre.pre.fix.pre.cant.pre.add.pre.new.pre.key.pre.during.pre.iteration.1 lib/lhs/problems/warnings.rb
lhs-21.1.0 lib/lhs/problems/warnings.rb