Module: ParseP1::Gas
- Included in:
- Base
- Defined in:
- lib/parse_p1/gas.rb
Instance Method Summary collapse
- #gas_meter_id ⇒ Object
- #gas_usage ⇒ Object
-
#last_hourly_reading_gas ⇒ Object
Only 2 digits for year!.
-
#measurement_unit_gas ⇒ Object
TODO remove this silly method?.
Instance Method Details
#gas_meter_id ⇒ Object
7 8 9 |
# File 'lib/parse_p1/gas.rb', line 7 def gas_meter_id obis_records['0-1:96.1.0'].first end |
#gas_usage ⇒ Object
22 23 24 25 |
# File 'lib/parse_p1/gas.rb', line 22 def gas_usage result = get_gas(-1) result.to_f if result end |
#last_hourly_reading_gas ⇒ Object
Only 2 digits for year!
12 13 14 15 |
# File 'lib/parse_p1/gas.rb', line 12 def last_hourly_reading_gas result = get_gas(0) DateTime.new(('20'+result[0..1]).to_i, result[2..3].to_i, result[4..5].to_i, result[6..7].to_i, result[8..9].to_i) if result end |
#measurement_unit_gas ⇒ Object
TODO remove this silly method?
18 19 20 |
# File 'lib/parse_p1/gas.rb', line 18 def measurement_unit_gas 'm3' end |