Class: Cabin::Metrics::Gauge
- Inherits:
-
Object
- Object
- Cabin::Metrics::Gauge
show all
- Includes:
- Cabin::Metric
- Defined in:
- lib/cabin/metrics/gauge.rb
Instance Method Summary
collapse
#emit, #instance, #instance=
Methods included from Publisher
#channel, #channel=, #publish
#inspect
Constructor Details
#initialize(&block) ⇒ Gauge
Returns a new instance of Gauge.
9
10
11
12
|
# File 'lib/cabin/metrics/gauge.rb', line 9
def initialize(&block)
@inspectables = [ ]
@block = block
end
|
Instance Method Details
#to_hash ⇒ Object
21
22
23
|
# File 'lib/cabin/metrics/gauge.rb', line 21
def to_hash
return { :value => value }
end
|
#value ⇒ Object
16
17
18
|
# File 'lib/cabin/metrics/gauge.rb', line 16
def value
return @block.call
end
|