Sha256: d689e043cd1c31029c7b3d0e0f3acf9a51e2866113b6049189a31652bcc75533

Contents?: true

Size: 588 Bytes

Versions: 13

Compression:

Stored size: 588 Bytes

Contents

module AbstractImporter
  class Summary < Struct.new(:total, :redundant, :created, :already_imported, :invalid, :ms, :skipped)

    def initialize(a=0, b=0, c=0, d=0, e=0, f=0, g=0)
      super(a,b,c,d,e,f,g)
    end

    def average_ms
      return nil if total == 0
      ms / total
    end

    def +(other)
      Summary.new(
        total + other.total,
        redundant + other.redundant,
        created + other.created,
        already_imported + other.already_imported,
        invalid + other.invalid,
        ms + other.ms,
        skipped + other.skipped)
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
abstract_importer-1.9.0 lib/abstract_importer/summary.rb
abstract_importer-1.8.0 lib/abstract_importer/summary.rb
abstract_importer-1.7.0 lib/abstract_importer/summary.rb
abstract_importer-1.6.0 lib/abstract_importer/summary.rb
abstract_importer-1.5.6 lib/abstract_importer/summary.rb
abstract_importer-1.5.5 lib/abstract_importer/summary.rb
abstract_importer-1.5.4 lib/abstract_importer/summary.rb
abstract_importer-1.5.3 lib/abstract_importer/summary.rb
abstract_importer-1.5.2 lib/abstract_importer/summary.rb
abstract_importer-1.5.1 lib/abstract_importer/summary.rb
abstract_importer-1.5.0 lib/abstract_importer/summary.rb
abstract_importer-1.4.1 lib/abstract_importer/summary.rb
abstract_importer-1.4.0 lib/abstract_importer/summary.rb