Class: Ixtlan::Remote::Summary

Inherits:
Object
  • Object
show all
Defined in:
lib/ixtlan/remote/summary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#countObject (readonly)

Returns the value of attribute count.



25
26
27
# File 'lib/ixtlan/remote/summary.rb', line 25

def count
  @count
end

#failuresObject (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_countObject



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_logObject



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