Class: Wildsight::Metrics::Counter
- Inherits:
-
Object
- Object
- Wildsight::Metrics::Counter
- Defined in:
- lib/wildsight/metrics/counter.rb
Instance Method Summary collapse
- #inc(value = 1) ⇒ Object
-
#initialize(value = 0) ⇒ Counter
constructor
A new instance of Counter.
- #set(value = 0) ⇒ Object
Constructor Details
#initialize(value = 0) ⇒ Counter
Returns a new instance of Counter.
6 7 8 |
# File 'lib/wildsight/metrics/counter.rb', line 6 def initialize(value = 0) set(value) end |
Instance Method Details
#inc(value = 1) ⇒ Object
10 11 12 |
# File 'lib/wildsight/metrics/counter.rb', line 10 def inc(value = 1) @value += value end |
#set(value = 0) ⇒ Object
14 15 16 |
# File 'lib/wildsight/metrics/counter.rb', line 14 def set(value = 0) @value = value end |