Class: TCellAgent::SensorEvents::Counter
- Inherits:
-
Object
- Object
- TCellAgent::SensorEvents::Counter
- Defined in:
- lib/tcell_agent/sensor_events/metrics.rb
Instance Attribute Summary collapse
-
#counter ⇒ Object
readonly
Returns the value of attribute counter.
Instance Method Summary collapse
- #add_object ⇒ Object
-
#initialize ⇒ Counter
constructor
A new instance of Counter.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Counter
Returns a new instance of Counter.
7 8 9 |
# File 'lib/tcell_agent/sensor_events/metrics.rb', line 7 def initialize @counter = 0 end |
Instance Attribute Details
#counter ⇒ Object (readonly)
Returns the value of attribute counter.
6 7 8 |
# File 'lib/tcell_agent/sensor_events/metrics.rb', line 6 def counter @counter end |
Instance Method Details
#add_object ⇒ Object
11 12 13 |
# File 'lib/tcell_agent/sensor_events/metrics.rb', line 11 def add_object @counter += 1 end |
#reset ⇒ Object
15 16 17 |
# File 'lib/tcell_agent/sensor_events/metrics.rb', line 15 def reset @counter = 0 end |