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-26.2.0 lib/lhs/problems/warnings.rb
lhs-26.1.0 lib/lhs/problems/warnings.rb
lhs-26.0.1 lib/lhs/problems/warnings.rb
lhs-26.0.0 lib/lhs/problems/warnings.rb
lhs-25.2.0 lib/lhs/problems/warnings.rb
lhs-25.1.0 lib/lhs/problems/warnings.rb
lhs-25.0.4 lib/lhs/problems/warnings.rb
lhs-25.0.3 lib/lhs/problems/warnings.rb
lhs-25.0.2 lib/lhs/problems/warnings.rb
lhs-25.0.1 lib/lhs/problems/warnings.rb
lhs-25.0.0 lib/lhs/problems/warnings.rb
lhs-24.1.2 lib/lhs/problems/warnings.rb
lhs-24.1.1 lib/lhs/problems/warnings.rb
lhs-24.1.0 lib/lhs/problems/warnings.rb
lhs-24.1.0.pre.2 lib/lhs/problems/warnings.rb
lhs-24.1.0.pre.1 lib/lhs/problems/warnings.rb
lhs-24.0.0 lib/lhs/problems/warnings.rb
lhs-23.0.2 lib/lhs/problems/warnings.rb
lhs-23.0.1 lib/lhs/problems/warnings.rb
lhs-23.0.0 lib/lhs/problems/warnings.rb