Class: Jiggler::Stats::Collection
- Inherits:
-
Object
- Object
- Jiggler::Stats::Collection
- Defined in:
- lib/jiggler/stats/collection.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#identity ⇒ Object
readonly
Returns the value of attribute identity.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #incr_failures ⇒ Object
- #incr_processed ⇒ Object
-
#initialize(uuid, identity) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(uuid, identity) ⇒ Collection
Returns a new instance of Collection.
8 9 10 11 12 13 14 15 16 |
# File 'lib/jiggler/stats/collection.rb', line 8 def initialize(uuid, identity) @uuid = uuid @identity = identity @data = { processed: 0, failures: 0, current_jobs: {} } end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/jiggler/stats/collection.rb', line 6 def data @data end |
#identity ⇒ Object (readonly)
Returns the value of attribute identity.
6 7 8 |
# File 'lib/jiggler/stats/collection.rb', line 6 def identity @identity end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
6 7 8 |
# File 'lib/jiggler/stats/collection.rb', line 6 def uuid @uuid end |
Instance Method Details
#incr_failures ⇒ Object
22 23 24 |
# File 'lib/jiggler/stats/collection.rb', line 22 def incr_failures @data[:failures] += 1 end |
#incr_processed ⇒ Object
18 19 20 |
# File 'lib/jiggler/stats/collection.rb', line 18 def incr_processed @data[:processed] += 1 end |