Class: Ixtlan::Remote::Summary
- Inherits:
-
Object
- Object
- Ixtlan::Remote::Summary
- Defined in:
- lib/ixtlan/remote/summary.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#failures ⇒ Object
readonly
Returns the value of attribute failures.
Instance Method Summary collapse
- #inc_count ⇒ Object
- #inc_failures(errors) ⇒ Object
-
#initialize(clazz) ⇒ Summary
constructor
A new instance of Summary.
- #to_log ⇒ Object
Constructor Details
#initialize(clazz) ⇒ Summary
Returns a new instance of Summary.
27 28 29 30 31 |
# File 'lib/ixtlan/remote/summary.rb', line 27 def initialize(clazz) @count = 0 @failures = [] @clazz = clazz end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
25 26 27 |
# File 'lib/ixtlan/remote/summary.rb', line 25 def count @count end |
#failures ⇒ Object (readonly)
Returns the value of attribute failures.
25 26 27 |
# File 'lib/ixtlan/remote/summary.rb', line 25 def failures @failures end |
Instance Method Details
#inc_count ⇒ Object
33 34 35 |
# File 'lib/ixtlan/remote/summary.rb', line 33 def inc_count @count += 1 end |
#inc_failures(errors) ⇒ Object
37 38 39 |
# File 'lib/ixtlan/remote/summary.rb', line 37 def inc_failures(errors) @failures << errors.inspect end |
#to_log ⇒ Object
41 42 43 |
# File 'lib/ixtlan/remote/summary.rb', line 41 def to_log "update #{@clazz} - total: #{@count + @failures.size} success: #{@count} failures: #{@failures.size == 0 ? 0 : @failures.join("\n\t\t")}" end |