Class: AEMO::Register
- Inherits:
-
Object
- Object
- AEMO::Register
- Defined in:
- lib/aemo/register.rb
Overview
AEMO::Register represents a register on a meter
Instance Attribute Summary collapse
-
#controlled_load ⇒ Object
Returns the value of attribute controlled_load.
-
#dial_format ⇒ Object
Returns the value of attribute dial_format.
-
#multiplier ⇒ Object
Returns the value of attribute multiplier.
-
#network_tariff_code ⇒ Object
Returns the value of attribute network_tariff_code.
-
#register_id ⇒ Object
Returns the value of attribute register_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#time_of_day ⇒ Object
Returns the value of attribute time_of_day.
-
#unit_of_measure ⇒ Object
Returns the value of attribute unit_of_measure.
Class Method Summary collapse
-
.from_hash(register) ⇒ AEMO::Register
Initialize a new register from an MSATS hash.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ AEMO::Register
constructor
Initialize a register.
Constructor Details
#initialize(opts = {}) ⇒ AEMO::Register
Initialize a register
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/aemo/register.rb', line 14 def initialize(opts = {}) @controlled_load = opts[:controlled_load] @dial_format = opts[:dial_format] @multiplier = opts[:multiplier] @network_tariff_code = opts[:network_tariff_code] @register_id = opts[:register_id] @status = opts[:status] @time_of_day = opts[:time_of_day] @unit_of_measure = opts[:unit_of_measure] end |
Instance Attribute Details
#controlled_load ⇒ Object
Returns the value of attribute controlled_load.
6 7 8 |
# File 'lib/aemo/register.rb', line 6 def controlled_load @controlled_load end |
#dial_format ⇒ Object
Returns the value of attribute dial_format.
6 7 8 |
# File 'lib/aemo/register.rb', line 6 def dial_format @dial_format end |
#multiplier ⇒ Object
Returns the value of attribute multiplier.
6 7 8 |
# File 'lib/aemo/register.rb', line 6 def multiplier @multiplier end |
#network_tariff_code ⇒ Object
Returns the value of attribute network_tariff_code.
6 7 8 |
# File 'lib/aemo/register.rb', line 6 def network_tariff_code @network_tariff_code end |
#register_id ⇒ Object
Returns the value of attribute register_id.
6 7 8 |
# File 'lib/aemo/register.rb', line 6 def register_id @register_id end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/aemo/register.rb', line 6 def status @status end |
#time_of_day ⇒ Object
Returns the value of attribute time_of_day.
6 7 8 |
# File 'lib/aemo/register.rb', line 6 def time_of_day @time_of_day end |
#unit_of_measure ⇒ Object
Returns the value of attribute unit_of_measure.
6 7 8 |
# File 'lib/aemo/register.rb', line 6 def unit_of_measure @unit_of_measure end |
Class Method Details
.from_hash(register) ⇒ AEMO::Register
Initialize a new register from an MSATS hash
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/aemo/register.rb', line 29 def self.from_hash(register) AEMO::Register.new( controlled_load: register['ControlledLoad'] == 'Y', dial_format: register['DialFormat'], multiplier: register['Multiplier'], network_tariff_code: register['NetworkTariffCode'], register_id: register['RegisterID'], status: register['Status'], time_of_day: register['TimeOfDay'], unit_of_measure: register['UnitOfMeasure'] ) end |