Class: CurrentCostDaemon::Publishers::Debug

Inherits:
Object
  • Object
show all
Defined in:
lib/currentcostd/publishers/debug.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Debug

Returns a new instance of Debug.



33
34
# File 'lib/currentcostd/publishers/debug.rb', line 33

def initialize(config)
end

Class Method Details

.config_sectionObject



29
30
31
# File 'lib/currentcostd/publishers/debug.rb', line 29

def self.config_section
  'debug'
end

Instance Method Details

#update(reading) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/currentcostd/publishers/debug.rb', line 36

def update(reading)
  # Print out measurement
  puts "New reading received: #{reading.total_watts} W"
rescue
  puts "Something went wrong (debug)!"
  puts $!.inspect
end