Sha256: b261ad786014ca61b9d31e2670be371f18ad4c153b86b11041ad70abc9418766

Contents?: true

Size: 684 Bytes

Versions: 2

Compression:

Stored size: 684 Bytes

Contents

module Topographer
  class Importer
    module Strategy
      class ImportStatus
        attr_reader :errors, :input_identifier, :timestamp
        attr_accessor :message

        def initialize(input_identifier)
          @input_identifier = input_identifier
          @errors = {mapping: [],
            validation: []}

        end

        def set_timestamp
          @timestamp ||= DateTime.now
        end

        def add_error(error_source, error)
          errors[error_source] << error
        end

        def error_count
          errors.values.flatten.length
        end

        def errors?
          errors.values.flatten.any?
        end

      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
topographer-0.0.9 lib/topographer/importer/strategy/import_status.rb
topographer-0.0.8 lib/topographer/importer/strategy/import_status.rb