aemo 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f13c2c3cba6af132505b335b02c89f824a9dc395
4
- data.tar.gz: bb6baee5af7b9e6678f66577de8a1b90286bbcb3
3
+ metadata.gz: b3e40a98a48936fc6d75e8ca014f672a364cf929
4
+ data.tar.gz: 40af65e47491619e9a0dfcfb3df1a612577b7dac
5
5
  SHA512:
6
- metadata.gz: 3ef0598c97beb9f2f6f9a149faa3dbf8912e169538b9e468e04aeb6109ecb1f9a651bd797fe80fa01a968de69e8651fa276802cbb00286e40b8e48c51dbf9c2a
7
- data.tar.gz: 21e5ca2a5203d48b0896315fe5704b0a4cba2409836e7e0aa058647a7ae7cba55a5820aa58860af032ecdb9336cade77d1c6c544f7b59d2ce59a564ef6d37c5e
6
+ metadata.gz: 7070f2d1022a383ddba4283f418f3e6c093500d14ee27632124609df94a6e23cd3bd55ffbd92ad849baa032488768ae5a4a508f1c5d19f89bbe0b80ff494445e
7
+ data.tar.gz: 884cd99295dbeeb6c302420d186e5c72dc3ff87b2217b3211e67ae7b211b52ae6babb793acc8e0aef87e302db0dacbe398949527879dddc8f05bf8e2853749c9
data/lib/aemo.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'active_support/all'
2
2
  require 'httparty'
3
3
  require 'csv'
4
- require 'pry'
5
4
 
6
5
  require 'aemo/market.rb'
7
6
  require 'aemo/market/interval.rb'
data/lib/aemo/market.rb CHANGED
@@ -2,11 +2,7 @@ module AEMO
2
2
  module Market
3
3
  include HTTParty
4
4
  base_uri 'www.nemweb.com.au'
5
-
6
- def self.regions
7
- AEMO::Region::REGIONS
8
- end
9
-
5
+
10
6
  def self.current_dispatch(region)
11
7
  response = AEMO::Market.get "/mms.GRAPHS/GRAPHS/GRAPH_5#{region}1.csv"
12
8
  values = AEMO::Market.parse_response(response)
@@ -18,7 +14,7 @@ module AEMO
18
14
  values = AEMO::Market.parse_response(response)
19
15
  values
20
16
  end
21
-
17
+
22
18
  # ######### #
23
19
  protected
24
20
  # ######### #
@@ -37,4 +33,3 @@ module AEMO
37
33
  end
38
34
 
39
35
  end
40
-
data/lib/aemo/msats.rb CHANGED
@@ -52,7 +52,7 @@ module AEMO
52
52
  options[:inittransId] ||= nil
53
53
 
54
54
  query = {
55
- transactionId: Digest::SHA1.hexdigest(Time.now.to_s)[0..35],
55
+ transactionId: transaction_id,
56
56
  NMI: nmi.nmi, # Note: AEMO has case sensitivity but no consistency across requests.
57
57
  fromDate: from_date,
58
58
  toDate: to_date,
@@ -74,11 +74,11 @@ module AEMO
74
74
  # /MSATSLimits/PARTICIPANT_IDENTIFIER?transactionId=XXX
75
75
  #
76
76
  # @return [Hash] The report results from the MSATS Limits web service query
77
- def self.msats_limits
77
+ def self.msats_limits(options={})
78
78
  query = {
79
- transactionId: Digest::SHA1.hexdigest(Time.now.to_s)[0..35],
79
+ transactionId: transaction_id,
80
80
  }
81
- response = self.get( "/MSATSLimits/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
81
+ response = self.get( "/MSATSLimits/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
82
82
  if response.response.code != '200'
83
83
  response
84
84
  else
@@ -91,13 +91,13 @@ module AEMO
91
91
  # @param [String] jurisdiction_code The Jurisdiction Code
92
92
  # @param [Integer] delivery_point_identifier Delivery Point Identifier
93
93
  # @return [Hash] The response
94
- def self.nmi_discovery_by_delivery_point_identifier(jurisdiction_code,delivery_point_identifier)
94
+ def self.nmi_discovery_by_delivery_point_identifier(jurisdiction_code,delivery_point_identifier,options={})
95
95
  raise ArgumentError, 'jurisdiction_code is not valid' unless %w(ACT NEM NSW QLD SA VIC TAS).include?(jurisdiction_code)
96
96
  raise ArgumentError, 'delivery_point_identifier is not valid' unless delivery_point_identifier.respond_to?("to_i")
97
97
  raise ArgumentError, 'delivery_point_identifier is not valid' if( delivery_point_identifier.to_i < 10000000 || delivery_point_identifier.to_i > 99999999)
98
98
 
99
99
  query = {
100
- transactionId: Digest::SHA1.hexdigest(Time.now.to_s)[0..35],
100
+ transactionId: transaction_id,
101
101
  jurisdictionCode: jurisdiction_code,
102
102
  deliveryPointIdentifier: delivery_point_identifier.to_i
103
103
  }
@@ -115,11 +115,11 @@ module AEMO
115
115
  # @param [String] jurisdiction_code The Jurisdiction Code
116
116
  # @param [Integer] meter_serial_number The meter's serial number
117
117
  # @return [Hash] The response
118
- def self.nmi_discovery_by_meter_serial_number(jurisdiction_code,meter_serial_number)
118
+ def self.nmi_discovery_by_meter_serial_number(jurisdiction_code,meter_serial_number,options={})
119
119
  raise ArgumentError, 'jurisdiction_code is not valid' unless %w(ACT NEM NSW QLD SA VIC TAS).include?(jurisdiction_code)
120
120
 
121
121
  query = {
122
- transactionId: Digest::SHA1.hexdigest(Time.now.to_s)[0..35],
122
+ transactionId: transaction_id,
123
123
  jurisdictionCode: jurisdiction_code,
124
124
  meterSerialNumber: meter_serial_number.to_i
125
125
  }
@@ -157,7 +157,7 @@ module AEMO
157
157
  options[:state_or_territory] ||= jurisdiction_code
158
158
 
159
159
  query = {
160
- transactionId: Digest::SHA1.hexdigest(Time.now.to_s)[0..35],
160
+ transactionId: transaction_id,
161
161
  jurisdictionCode: jurisdiction_code,
162
162
  buildingOrPropertyName: options[:building_or_property_name],
163
163
  locationDescriptor: options[:location_descriptor],
@@ -197,7 +197,7 @@ module AEMO
197
197
  options[:reason] ||= nil
198
198
 
199
199
  query = {
200
- transactionId: Digest::SHA1.hexdigest(Time.now.to_s)[0..35],
200
+ transactionId: transaction_id,
201
201
  nmi: nmi.nmi,
202
202
  checksum: nmi.checksum,
203
203
  type: options[:type],
@@ -216,9 +216,9 @@ module AEMO
216
216
  # /ParticipantSystemStatus/PARTICIPANT_IDENTIFIER?transactionId=XXX
217
217
  #
218
218
  # @return [Hash] The report results from the Participant System Status web service query
219
- def self.system_status
219
+ def self.system_status(options={})
220
220
  query = {
221
- transactionId: Digest::SHA1.hexdigest(Time.now.to_s)[0..35],
221
+ transactionId: transaction_id,
222
222
  }
223
223
  response = self.get( "/ParticipantSystemStatus/#{@@participant_id}", basic_auth: @@auth, headers: { 'Accept' => 'text/xml', 'Content-Type' => 'text/xml'}, query: query, verify: (options[:verify_ssl] != false) )
224
224
  if response.response.code != '200'
@@ -246,5 +246,12 @@ module AEMO
246
246
  !(@@participant_id.nil? || @@auth[:username].nil? || @@auth[:password].nil?)
247
247
  end
248
248
 
249
+ # Method for creating a unique transaction id
250
+ #
251
+ # @return [String] the transaction id
252
+ def self.transaction_id
253
+ Digest::SHA1.hexdigest(Time.now.to_s)[0..35]
254
+ end
255
+
249
256
  end
250
257
  end
data/lib/aemo/nem12.rb CHANGED
@@ -265,7 +265,7 @@ module AEMO
265
265
 
266
266
  # Initialize a NEM12 file
267
267
  def initialize(nmi,options={})
268
- @nmi = nmi
268
+ @nmi = AEMO::NMI.new(nmi) unless nmi.empty?
269
269
  @data_details = []
270
270
  @interval_data = []
271
271
  @interval_events = []
@@ -274,21 +274,6 @@ module AEMO
274
274
  end
275
275
  end
276
276
 
277
- # @return [Integer] checksum of the NMI
278
- def nmi_checksum
279
- summation = 0
280
- @nmi.reverse.split(//).each_index do |i|
281
- value = nmi[nmi.length - i - 1].ord
282
- if(i % 2 == 0)
283
- value = value * 2
284
- end
285
- value = value.to_s.split(//).map{|i| i.to_i}.reduce(:+)
286
- summation += value
287
- end
288
- checksum = (10 - (summation % 10)) % 10
289
- checksum
290
- end
291
-
292
277
  # Parses the header record
293
278
  # @param line [String] A single line in string format
294
279
  # @return [Hash] the line parsed into a hash of information
@@ -319,10 +304,10 @@ module AEMO
319
304
  csv = line.parse_csv
320
305
 
321
306
  raise ArgumentError, 'RecordIndicator is not 200' if csv[0] != '200'
322
- raise ArgumentError, 'NMI is not valid' if csv[1].match(/[A-Z0-9]{10}/).nil?
307
+ raise ArgumentError, 'NMI is not valid' if !AEMO::NMI.valid_nmi?(csv[1])
323
308
  raise ArgumentError, 'NMIConfiguration is not valid' if csv[2].match(/.{1,240}/).nil?
324
309
  unless csv[3].nil?
325
- raise ArgumentError, 'RegisterID is not valid' if csv[3].match(/.{1,10}/).nil?
310
+ raise ArgumentError, 'RegisterID is not valid' if csv[3].match(/.{1,10}/).nil?
326
311
  end
327
312
  raise ArgumentError, 'NMISuffix is not valid' if csv[4].match(/[A-HJ-NP-Z][1-9A-HJ-NP-Z]/).nil?
328
313
  if !csv[5].nil? && !csv[5].empty? && !csv[5].match(/^\s*$/)
@@ -336,7 +321,7 @@ module AEMO
336
321
  raise ArgumentError, 'IntervalLength is not valid' unless %w(1 5 10 15 30).include?(csv[8])
337
322
  # raise ArgumentError, 'NextScheduledReadDate is not valid' if csv[9].match(/\d{8}/).nil? || csv[9] != Time.parse("#{csv[9]}").strftime('%Y%m%d')
338
323
 
339
- @nmi = csv[1]
324
+ @nmi = AEMO::NMI.new(csv[1])
340
325
 
341
326
  # Push onto the stack
342
327
  @data_details << {
@@ -501,12 +486,6 @@ module AEMO
501
486
  ([headers]+self.to_a.map{|row| row[3]=row[3].strftime("%Y%m%d%H%M%S%z"); row}).map{|row| row.join(',')}.join("\n")
502
487
  end
503
488
 
504
- # @param nmi [String] a NMI that is to be checked for validity
505
- # @return [Boolean] determines if the NMI is valid
506
- def self.valid_nmi?(nmi)
507
- (nmi.class == String && nmi.length == 10 && !nmi.match(/^[A-Z1-9][A-Z0-9]{9}$/).nil?)
508
- end
509
-
510
489
  # @param path_to_file [String] the path to a file
511
490
  # @return [] NEM12 object
512
491
  def self.parse_nem12_file(path_to_file, strict = false)
data/lib/aemo/nmi.rb CHANGED
@@ -25,8 +25,8 @@ module AEMO
25
25
  state: 'ACT',
26
26
  type: 'electricity',
27
27
  includes: [
28
- (/^(NGGG[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
29
- (/^(7001\d{6})$/)
28
+ /^(NGGG[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
29
+ /^(7001\d{6})$/
30
30
  ],
31
31
  excludes: [
32
32
  ]
@@ -37,14 +37,14 @@ module AEMO
37
37
  state: 'NSW',
38
38
  type: 'electricity',
39
39
  includes: [
40
- (/^(NAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
41
- (/^(NBBB[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
42
- (/^(NDDD[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
43
- (/^(NFFF[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
44
- (/^(4001\d{6})$/),
45
- (/^(4508\d{6})$/),
46
- (/^(4204\d{6})$/),
47
- (/^(4407\d{6})$/)
40
+ /^(NAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
41
+ /^(NBBB[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
42
+ /^(NDDD[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
43
+ /^(NFFF[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
44
+ /^(4001\d{6})$/,
45
+ /^(4508\d{6})$/,
46
+ /^(4204\d{6})$/,
47
+ /^(4407\d{6})$/
48
48
  ],
49
49
  excludes: [
50
50
  ]
@@ -55,8 +55,8 @@ module AEMO
55
55
  state: 'NSW',
56
56
  type: 'electricity',
57
57
  includes: [
58
- (/^(NCCC[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
59
- (/^(410[234]\d{6})$/)
58
+ /^(NCCC[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
59
+ /^(410[234]\d{6})$/
60
60
  ],
61
61
  excludes: [
62
62
  ]
@@ -67,8 +67,8 @@ module AEMO
67
67
  state: 'NSW',
68
68
  type: 'electricity',
69
69
  includes: [
70
- (/^(NEEE[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
71
- (/^(431\d{7})$/)
70
+ /^(NEEE[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
71
+ /^(431\d{7})$/
72
72
  ],
73
73
  excludes: [
74
74
  ]
@@ -79,8 +79,8 @@ module AEMO
79
79
  state: 'NSW',
80
80
  type: 'electricity',
81
81
  includes: [
82
- (/^(NTTT[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
83
- (/^(460810[0-8]\d{3})$/)
82
+ /^(NTTT[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
83
+ /^(460810[0-8]\d{3})$/
84
84
  ],
85
85
  excludes: [
86
86
  ]
@@ -91,7 +91,7 @@ module AEMO
91
91
  state: 'NSW',
92
92
  type: 'electricity',
93
93
  includes: [
94
- (/^(4708109\d{3})$/)
94
+ /^(4708109\d{3})$/
95
95
  ],
96
96
  excludes: [
97
97
  ]
@@ -102,7 +102,7 @@ module AEMO
102
102
  state: 'NT',
103
103
  type: 'electricity',
104
104
  includes: [
105
- (/^(250\d{7})$/)
105
+ /^(250\d{7})$/
106
106
  ],
107
107
  excludes: [
108
108
  ]
@@ -113,13 +113,13 @@ module AEMO
113
113
  state: 'QLD',
114
114
  type: 'electricity',
115
115
  includes: [
116
- (/^(QAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
117
- (/^(QCCC[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
118
- (/^(QDDD[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
119
- (/^(QEEE[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
120
- (/^(QFFF[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
121
- (/^(QGGG[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
122
- (/^(30\d{8})$/)
116
+ /^(QAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
117
+ /^(QCCC[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
118
+ /^(QDDD[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
119
+ /^(QEEE[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
120
+ /^(QFFF[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
121
+ /^(QGGG[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
122
+ /^(30\d{8})$/
123
123
  ],
124
124
  excludes: [
125
125
  ]
@@ -130,8 +130,8 @@ module AEMO
130
130
  state: 'QLD',
131
131
  type: 'electricity',
132
132
  includes: [
133
- (/^(QB\d{2}[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
134
- (/^(31\d{8})$/)
133
+ /^(QB\d{2}[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
134
+ /^(31\d{8})$/
135
135
  ],
136
136
  excludes: [
137
137
  ]
@@ -142,8 +142,8 @@ module AEMO
142
142
  state: 'QLD',
143
143
  type: 'electricity',
144
144
  includes: [
145
- (/^(Q[A-HJ-NP-Z\d]{3}W[A-HJ-NP-Z\d]{5})$/),
146
- (/^(320200\d{4})$/)
145
+ /^(Q[A-HJ-NP-Z\d]{3}W[A-HJ-NP-Z\d]{5})$/,
146
+ /^(320200\d{4})$/
147
147
  ],
148
148
  excludes: [
149
149
  ]
@@ -154,9 +154,9 @@ module AEMO
154
154
  state: 'SA',
155
155
  type: 'electricity',
156
156
  includes: [
157
- (/^(SAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
158
- (/^(SASMPL[\d]{4})$/),
159
- (/^(200[12]\d{6})$/)
157
+ /^(SAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
158
+ /^(SASMPL[\d]{4})$/,
159
+ /^(200[12]\d{6})$/
160
160
  ],
161
161
  excludes: [
162
162
  ]
@@ -167,8 +167,8 @@ module AEMO
167
167
  state: 'SA',
168
168
  type: 'electricity',
169
169
  includes: [
170
- (/^(S[A-HJ-NP-Z\d]{3}W[A-HJ-NP-Z\d]{5})$/),
171
- (/^(210200\d{4})$/)
170
+ /^(S[A-HJ-NP-Z\d]{3}W[A-HJ-NP-Z\d]{5})$/,
171
+ /^(210200\d{4})$/
172
172
  ],
173
173
  excludes: [
174
174
  ]
@@ -179,9 +179,9 @@ module AEMO
179
179
  state: 'TAS',
180
180
  type: 'electricity',
181
181
  includes: [
182
- (/^(T000000(([0-4]\d{3})|(500[01])))$/),
183
- (/^(8000\d{6})$/),
184
- (/^(8590[23]\d{5})$/)
182
+ /^(T000000(([0-4]\d{3})|(500[01])))$/,
183
+ /^(8000\d{6})$/,
184
+ /^(8590[23]\d{5})$/
185
185
  ],
186
186
  excludes: [
187
187
  ]
@@ -192,7 +192,7 @@ module AEMO
192
192
  state: 'TAS',
193
193
  type: 'electricity',
194
194
  includes: [
195
- (/^(T[A-HJ-NP-Z\d]{3}W[A-HJ-NP-Z\d]{5})$/),
195
+ /^(T[A-HJ-NP-Z\d]{3}W[A-HJ-NP-Z\d]{5})$/,
196
196
  ],
197
197
  excludes: [
198
198
  ]
@@ -203,8 +203,8 @@ module AEMO
203
203
  state: 'VIC',
204
204
  type: 'electricity',
205
205
  includes: [
206
- (/^(VAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
207
- (/^(610[23]\d{6})$/)
206
+ /^(VAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
207
+ /^(610[23]\d{6})$/
208
208
  ],
209
209
  excludes: [
210
210
  ]
@@ -215,8 +215,8 @@ module AEMO
215
215
  state: 'VIC',
216
216
  type: 'electricity',
217
217
  includes: [
218
- (/^(VBBB[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
219
- (/^(630[56]\d{6})$/)
218
+ /^(VBBB[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
219
+ /^(630[56]\d{6})$/
220
220
  ],
221
221
  excludes: [
222
222
  ]
@@ -227,8 +227,8 @@ module AEMO
227
227
  state: 'VIC',
228
228
  type: 'electricity',
229
229
  includes: [
230
- (/^(VCCC[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
231
- (/^(620[34]\d{6})$/)
230
+ /^(VCCC[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
231
+ /^(620[34]\d{6})$/
232
232
  ],
233
233
  excludes: [
234
234
  ]
@@ -239,8 +239,8 @@ module AEMO
239
239
  state: 'VIC',
240
240
  type: 'electricity',
241
241
  includes: [
242
- (/^(VDDD[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
243
- (/^(6001\d{6})$/)
242
+ /^(VDDD[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
243
+ /^(6001\d{6})$/
244
244
  ],
245
245
  excludes: [
246
246
  ]
@@ -251,8 +251,8 @@ module AEMO
251
251
  state: 'VIC',
252
252
  type: 'electricity',
253
253
  includes: [
254
- (/^(VEEE[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
255
- (/^(640[78]\d{6})$/)
254
+ /^(VEEE[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
255
+ /^(640[78]\d{6})$/
256
256
  ],
257
257
  excludes: [
258
258
  ]
@@ -263,8 +263,8 @@ module AEMO
263
263
  state: 'VIC',
264
264
  type: 'electricity',
265
265
  includes: [
266
- (/^(V[A-HJ-NP-Z\d]{3}W[A-HJ-NP-Z\d]{5})$/),
267
- (/^(650900\d{4})$/)
266
+ /^(V[A-HJ-NP-Z\d]{3}W[A-HJ-NP-Z\d]{5})$/,
267
+ /^(650900\d{4})$/
268
268
  ],
269
269
  excludes: [
270
270
  ]
@@ -275,10 +275,10 @@ module AEMO
275
275
  state: 'WA',
276
276
  type: 'electricity',
277
277
  includes: [
278
- (/^(WAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
279
- (/^(800[1-9]\d{6})$/),
280
- (/^(801\d{7})$/),
281
- (/^(8020\d{6})$/)
278
+ /^(WAAA[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
279
+ /^(800[1-9]\d{6})$/,
280
+ /^(801\d{7})$/,
281
+ /^(8020\d{6})$/
282
282
  ],
283
283
  excludes: [
284
284
  ]
@@ -289,7 +289,7 @@ module AEMO
289
289
  state: 'WA',
290
290
  type: 'electricity',
291
291
  includes: [
292
- (/^(8021\d{6})$/)
292
+ /^(8021\d{6})$/
293
293
  ],
294
294
  excludes: [
295
295
  ]
@@ -300,7 +300,7 @@ module AEMO
300
300
  state: 'NSW',
301
301
  type: 'gas',
302
302
  includes: [
303
- (/^(52\d{8})$/)
303
+ /^(52\d{8})$/
304
304
  ],
305
305
  excludes: [
306
306
  ]
@@ -311,7 +311,7 @@ module AEMO
311
311
  state: 'VIC',
312
312
  type: 'gas',
313
313
  includes: [
314
- (/^(53\d{8})$/)
314
+ /^(53\d{8})$/
315
315
  ],
316
316
  excludes: [
317
317
  ]
@@ -322,7 +322,7 @@ module AEMO
322
322
  state: 'QLD',
323
323
  type: 'gas',
324
324
  includes: [
325
- (/^(54\d{8})$/)
325
+ /^(54\d{8})$/
326
326
  ],
327
327
  excludes: [
328
328
  ]
@@ -333,7 +333,7 @@ module AEMO
333
333
  state: 'SA',
334
334
  type: 'gas',
335
335
  includes: [
336
- (/^(55\d{8})$/)
336
+ /^(55\d{8})$/
337
337
  ],
338
338
  excludes: [
339
339
  ]
@@ -344,7 +344,7 @@ module AEMO
344
344
  state: 'WA',
345
345
  type: 'gas',
346
346
  includes: [
347
- (/^(56\d{8})$/)
347
+ /^(56\d{8})$/
348
348
  ],
349
349
  excludes: [
350
350
  ]
@@ -355,7 +355,7 @@ module AEMO
355
355
  state: 'TAS',
356
356
  type: 'gas',
357
357
  includes: [
358
- (/^(57\d{8})$/)
358
+ /^(57\d{8})$/
359
359
  ],
360
360
  excludes: [
361
361
  ]
@@ -366,7 +366,7 @@ module AEMO
366
366
  state: 'NSW',
367
367
  type: 'electricity',
368
368
  includes: [
369
- (/^(NJJJNR[A-HJ-NP-Z\d]{4})$/)
369
+ /^(NJJJNR[A-HJ-NP-Z\d]{4})$/
370
370
  ],
371
371
  excludes: [
372
372
  ]
@@ -377,8 +377,8 @@ module AEMO
377
377
  state: '',
378
378
  type: 'electricity',
379
379
  includes: [
380
- (/^(NKKK[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/),
381
- (/^(7102\d{6})$/)
380
+ /^(NKKK[A-HJ-NP-VX-Z\d][A-HJ-NP-Z\d]{5})$/,
381
+ /^(7102\d{6})$/
382
382
  ],
383
383
  excludes: [
384
384
  ]
@@ -389,8 +389,8 @@ module AEMO
389
389
  state: '',
390
390
  type: 'electricity',
391
391
  includes: [
392
- (/^(880[1-5]\d{6})$/),
393
- (/^(9\d{9})$/)
392
+ /^(880[1-5]\d{6})$/,
393
+ /^(9\d{9})$/
394
394
  ],
395
395
  excludes: [
396
396
  ]
@@ -665,10 +665,6 @@ module AEMO
665
665
  protected
666
666
  # ######### #
667
667
 
668
- def is_valid_region?(region)
669
- REGIONS.keys.include?(region)
670
- end
671
-
672
668
  end
673
669
 
674
670
  end