class P1MeterReader::Models::Measurement

Attributes

diff_gas[RW]
diff_stroom_dal[RW]
diff_stroom_piek[RW]
gas[RW]
stroom_current[RW]
stroom_dal[RW]
stroom_piek[RW]
time_stamp[RW]
time_stamp_utc[RW]

Public Instance Methods

time_stamp_current_minute() click to toggle source
# File lib/p1_meter_reader/models/measurement.rb, line 7
def time_stamp_current_minute
  self.time_stamp.strftime("%d-%m-%y %H:%M")
end
time_stamp_next_minute() click to toggle source
# File lib/p1_meter_reader/models/measurement.rb, line 11
def time_stamp_next_minute
  next_minute = self.time_stamp + 1.0/(24*60)
  next_minute.strftime("%d-%m-%y %H:%M")
end
to_s() click to toggle source
# File lib/p1_meter_reader/models/measurement.rb, line 16
def to_s
  date = self.time_stamp.strftime("%d-%m-%y %H:%M:%S")

  "#{date}: #{stroom_dal} - #{stroom_piek} - #{stroom_current} - #{gas}"
end