Class: Flukso::Detail_Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/flukso/export.rb

Instance Method Summary collapse

Constructor Details

#initializeDetail_Exporter

Returns a new instance of Detail_Exporter.



42
43
44
# File 'lib/flukso/export.rb', line 42

def initialize()
  $stderr.puts("Using Detail Exporter");
end

Instance Method Details

#format_reading(reading) ⇒ Object



48
49
50
51
52
# File 'lib/flukso/export.rb', line 48

def format_reading(reading)
  currenttime=Time.at(reading.utc_timestamp);
  period=(currenttime.hour * 4) + (currenttime.min / 15);
  puts "#{currenttime.strftime("%Y-%m-%d\t%H:%M\t%a")}\t#{period}\t#{reading.value}"
end


45
46
47
# File 'lib/flukso/export.rb', line 45

def print_header()
  puts "date \ttime\tdayofweek\tperiod\tvalue"
end