Class: AbstractImporter::Summary
- Inherits:
-
Struct
- Object
- Struct
- AbstractImporter::Summary
- Defined in:
- lib/abstract_importer/summary.rb
Instance Attribute Summary collapse
-
#already_imported ⇒ Object
Returns the value of attribute already_imported.
-
#created ⇒ Object
Returns the value of attribute created.
-
#invalid ⇒ Object
Returns the value of attribute invalid.
-
#ms ⇒ Object
Returns the value of attribute ms.
-
#redundant ⇒ Object
Returns the value of attribute redundant.
-
#skipped ⇒ Object
Returns the value of attribute skipped.
-
#total ⇒ Object
Returns the value of attribute total.
Instance Method Summary collapse
- #+(other) ⇒ Object
- #average_ms ⇒ Object
-
#initialize(a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0) ⇒ Summary
constructor
A new instance of Summary.
Constructor Details
#initialize(a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0) ⇒ Summary
Returns a new instance of Summary.
4 5 6 |
# File 'lib/abstract_importer/summary.rb', line 4 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 |
Instance Attribute Details
#already_imported ⇒ Object
Returns the value of attribute already_imported
2 3 4 |
# File 'lib/abstract_importer/summary.rb', line 2 def already_imported @already_imported end |
#created ⇒ Object
Returns the value of attribute created
2 3 4 |
# File 'lib/abstract_importer/summary.rb', line 2 def created @created end |
#invalid ⇒ Object
Returns the value of attribute invalid
2 3 4 |
# File 'lib/abstract_importer/summary.rb', line 2 def invalid @invalid end |
#ms ⇒ Object
Returns the value of attribute ms
2 3 4 |
# File 'lib/abstract_importer/summary.rb', line 2 def ms @ms end |
#redundant ⇒ Object
Returns the value of attribute redundant
2 3 4 |
# File 'lib/abstract_importer/summary.rb', line 2 def redundant @redundant end |
#skipped ⇒ Object
Returns the value of attribute skipped
2 3 4 |
# File 'lib/abstract_importer/summary.rb', line 2 def skipped @skipped end |
#total ⇒ Object
Returns the value of attribute total
2 3 4 |
# File 'lib/abstract_importer/summary.rb', line 2 def total @total end |
Instance Method Details
#+(other) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/abstract_importer/summary.rb', line 13 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 |
#average_ms ⇒ Object
8 9 10 11 |
# File 'lib/abstract_importer/summary.rb', line 8 def average_ms return nil if total == 0 ms / total end |