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