Class: P1MeterReader::Models::Measurement
- Inherits:
-
Object
- Object
- P1MeterReader::Models::Measurement
- Defined in:
- lib/p1_meter_reader/models/measurement.rb
Instance Attribute Summary collapse
-
#diff_gas ⇒ Object
Returns the value of attribute diff_gas.
-
#diff_stroom_dal ⇒ Object
Returns the value of attribute diff_stroom_dal.
-
#diff_stroom_piek ⇒ Object
Returns the value of attribute diff_stroom_piek.
-
#gas ⇒ Object
Returns the value of attribute gas.
-
#stroom_current ⇒ Object
Returns the value of attribute stroom_current.
-
#stroom_dal ⇒ Object
Returns the value of attribute stroom_dal.
-
#stroom_piek ⇒ Object
Returns the value of attribute stroom_piek.
-
#time_stamp ⇒ Object
Returns the value of attribute time_stamp.
-
#time_stamp_utc ⇒ Object
Returns the value of attribute time_stamp_utc.
Instance Method Summary collapse
Instance Attribute Details
#diff_gas ⇒ Object
Returns the value of attribute diff_gas.
5 6 7 |
# File 'lib/p1_meter_reader/models/measurement.rb', line 5 def diff_gas @diff_gas end |
#diff_stroom_dal ⇒ Object
Returns the value of attribute diff_stroom_dal.
5 6 7 |
# File 'lib/p1_meter_reader/models/measurement.rb', line 5 def diff_stroom_dal @diff_stroom_dal end |
#diff_stroom_piek ⇒ Object
Returns the value of attribute diff_stroom_piek.
5 6 7 |
# File 'lib/p1_meter_reader/models/measurement.rb', line 5 def diff_stroom_piek @diff_stroom_piek end |
#gas ⇒ Object
Returns the value of attribute gas.
4 5 6 |
# File 'lib/p1_meter_reader/models/measurement.rb', line 4 def gas @gas end |
#stroom_current ⇒ Object
Returns the value of attribute stroom_current.
4 5 6 |
# File 'lib/p1_meter_reader/models/measurement.rb', line 4 def stroom_current @stroom_current end |
#stroom_dal ⇒ Object
Returns the value of attribute stroom_dal.
4 5 6 |
# File 'lib/p1_meter_reader/models/measurement.rb', line 4 def stroom_dal @stroom_dal end |
#stroom_piek ⇒ Object
Returns the value of attribute stroom_piek.
4 5 6 |
# File 'lib/p1_meter_reader/models/measurement.rb', line 4 def stroom_piek @stroom_piek end |
#time_stamp ⇒ Object
Returns the value of attribute time_stamp.
4 5 6 |
# File 'lib/p1_meter_reader/models/measurement.rb', line 4 def time_stamp @time_stamp end |
#time_stamp_utc ⇒ Object
Returns the value of attribute time_stamp_utc.
4 5 6 |
# File 'lib/p1_meter_reader/models/measurement.rb', line 4 def time_stamp_utc @time_stamp_utc end |
Instance Method Details
#time_stamp_current_minute ⇒ Object
7 8 9 |
# 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 ⇒ Object
11 12 13 14 |
# 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 ⇒ Object
16 17 18 19 20 |
# 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 |