Class: AEMO::Region Abstract
- Inherits:
-
Object
- Object
- AEMO::Region
- Defined in:
- lib/aemo/region.rb,
lib/aemo/dispatchable.rb
Overview
This class is abstract.
AEMO::Region
Constant Summary collapse
- REGIONS =
Regions under juristiction
{ 'ACT' => 'Australian Capital Territory', 'NSW' => 'New South Wales', 'QLD' => 'Queensland', 'SA' => 'South Australia', 'TAS' => 'Tasmania', 'VIC' => 'Victoria', 'NT' => 'Northern Territory', 'WA' => 'Western Australia' }.freeze
- DISPATCH_TYPE =
['Generator', 'Load Norm Off', 'Network Service Provider'].freeze
- CATEGORY =
%w[Market Non-Market].freeze
- CLASSIFICATION =
%w[Scheduled Semi-Scheduled Non-Scheduled].freeze
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#abbr ⇒ String
Abbreviation method.
-
#current_dispatch ⇒ Array<AEMO::Market::Interval>
Return the current dispatch data.
-
#current_trading ⇒ Array<AEMO::Market::Interval>
Return the current trading data.
- #fullname ⇒ String
-
#initialize(region) ⇒ self
constructor
Create a new instance of AEMO::Region.
- #to_s ⇒ String
Constructor Details
#initialize(region) ⇒ self
Create a new instance of AEMO::Region
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/aemo/region.rb', line 35 def initialize(region) raise ArgumentError, "Region '#{region}' is not valid." unless valid_region?(region) @region = region.upcase @full_name = REGIONS[@region] @current_trading = [] @current_dispatch = [] @aemo_market_node = if %w[NSW QLD SA TAS VIC].include?(@region) AEMO::Market::Node.new(region) elsif @region == 'ACT' AEMO::Market::Node.new('NSW') end end |
Instance Attribute Details
#aemo_market_node ⇒ Object (readonly)
23 24 25 |
# File 'lib/aemo/region.rb', line 23 def aemo_market_node @aemo_market_node end |
#region ⇒ Object
22 23 24 |
# File 'lib/aemo/region.rb', line 22 def region @region end |
Class Method Details
Instance Method Details
#abbr ⇒ String
Abbreviation method
52 53 54 |
# File 'lib/aemo/region.rb', line 52 def abbr @region end |
#current_dispatch ⇒ Array<AEMO::Market::Interval>
Return the current dispatch data
69 70 71 |
# File 'lib/aemo/region.rb', line 69 def current_dispatch @aemo_market_node.current_dispatch end |
#current_trading ⇒ Array<AEMO::Market::Interval>
Return the current trading data
76 77 78 |
# File 'lib/aemo/region.rb', line 76 def current_trading @aemo_market_node.current_trading end |
#to_s ⇒ String
57 58 59 |
# File 'lib/aemo/region.rb', line 57 def to_s @region end |