Class: Metrux::Commands::Meter
- Defined in:
- lib/metrux/commands/meter.rb
Constant Summary collapse
- METER_MEASUREMENT_PREFIX_KEY =
'meters/'.freeze
Constants inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Metrux::Commands::Base
Instance Method Details
#execute(key, params = {}) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/metrux/commands/meter.rb', line 6 def execute(key, params = {}) key = "#{METER_MEASUREMENT_PREFIX_KEY}#{key}" value = params.fetch(:value, 1).to_i write(key, format_data(value, params), (params)) end |