Class: Wildsight::Metrics::Gauge

Inherits:
Object
  • Object
show all
Defined in:
lib/wildsight/metrics/gauge.rb

Instance Method Summary collapse

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