Class: Flukso::Detail_Exporter
- Inherits:
-
Object
- Object
- Flukso::Detail_Exporter
- Defined in:
- lib/flukso/export.rb
Instance Method Summary collapse
- #format_reading(reading) ⇒ Object
-
#initialize ⇒ Detail_Exporter
constructor
A new instance of Detail_Exporter.
- #print_header ⇒ Object
Constructor Details
#initialize ⇒ Detail_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.); period=(currenttime.hour * 4) + (currenttime.min / 15); puts "#{currenttime.strftime("%Y-%m-%d\t%H:%M\t%a")}\t#{period}\t#{reading.value}" end |
#print_header ⇒ Object
45 46 47 |
# File 'lib/flukso/export.rb', line 45 def print_header() puts "date \ttime\tdayofweek\tperiod\tvalue" end |