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-21.0.0 lib/lhs/problems/warnings.rb
lhs-20.1.4 lib/lhs/problems/warnings.rb
lhs-20.1.3.pre.paginationfix.3 lib/lhs/problems/warnings.rb
lhs-20.1.3.pre.paginationfix.2 lib/lhs/problems/warnings.rb
lhs-20.1.3.pre.paginationfix.1 lib/lhs/problems/warnings.rb
lhs-20.1.2 lib/lhs/problems/warnings.rb
lhs-20.1.1 lib/lhs/problems/warnings.rb
lhs-20.0.0 lib/lhs/problems/warnings.rb
lhs-19.10.0 lib/lhs/problems/warnings.rb
lhs-19.9.0 lib/lhs/problems/warnings.rb
lhs-19.8.2 lib/lhs/problems/warnings.rb
lhs-19.8.1 lib/lhs/problems/warnings.rb
lhs-19.8.0 lib/lhs/problems/warnings.rb
lhs-19.7.0 lib/lhs/problems/warnings.rb
lhs-19.6.0 lib/lhs/problems/warnings.rb
lhs-19.5.0 lib/lhs/problems/warnings.rb
lhs-19.5.0.pre.wherehref.1 lib/lhs/problems/warnings.rb
lhs-19.4.1 lib/lhs/problems/warnings.rb
lhs-19.4.0 lib/lhs/problems/warnings.rb
lhs-19.3.1 lib/lhs/problems/warnings.rb