Sha256: b3307b3a95ca417683362f3b6ef36dbca01e7bb4bc60f7c5ae12faaeada52305

Contents?: true

Size: 550 Bytes

Versions: 43

Compression:

Stored size: 550 Bytes

Contents

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

43 entries across 43 versions & 1 rubygems

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