Class: TCellAgent::SensorEvents::Counter

Inherits:
Object
  • Object
show all
Defined in:
lib/tcell_agent/sensor_events/metrics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCounter

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

#counterObject (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_objectObject



11
12
13
# File 'lib/tcell_agent/sensor_events/metrics.rb', line 11

def add_object
  @counter += 1
end

#resetObject



15
16
17
# File 'lib/tcell_agent/sensor_events/metrics.rb', line 15

def reset
  @counter = 0
end