Skip to content

Commit

Permalink
Local tests passed but shouldn't?
Browse files Browse the repository at this point in the history
  • Loading branch information
jufemaiz committed Mar 10, 2020
1 parent f98724c commit 6b6f18a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/aemo/nem12.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ class NEM12
attr_accessor :file_contents, :header, :nmi_data_details, :nmi

# Initialize a NEM12 file
# @param [string] nmi
# @param [Hash] options
def initialize(nmi, options = {})
@nmi = AEMO::NMI.new(nmi) unless nmi.empty?
@data_details = []
Expand All @@ -291,6 +293,7 @@ def nmi_identifier

# Parses the header record
# @param [String] line A single line in string format
# @param [Hash] options
# @return [Hash] the line parsed into a hash of information
def self.parse_nem12_100(line, options = {})
csv = line.parse_csv
Expand All @@ -312,6 +315,7 @@ def self.parse_nem12_100(line, options = {})

# Parses the NMI Data Details
# @param [String] line A single line in string format
# @param [Hash] options
# @return [Hash] the line parsed into a hash of information
def parse_nem12_200(line, options = {})
csv = line.parse_csv
Expand Down Expand Up @@ -346,6 +350,7 @@ def parse_nem12_200(line, options = {})
end

# @param [String] line A single line in string format
# @param [Hash] options
# @return [Array of hashes] the line parsed into a hash of information
def parse_nem12_300(line, options = {})
csv = line.parse_csv
Expand Down Expand Up @@ -427,8 +432,9 @@ def parse_nem12_300(line, options = {})
end

# @param [String] line A single line in string format
# @param [Hash] options
# @return [Hash] the line parsed into a hash of information
def parse_nem12_400(line)
def parse_nem12_400(line, options = {})
csv = line.parse_csv
raise ArgumentError, 'RecordIndicator is not 400' if csv[0] != '400'
raise ArgumentError, 'StartInterval is not valid' if csv[1].nil? || csv[1].match(/^\d+$/).nil?
Expand Down Expand Up @@ -467,11 +473,17 @@ def parse_nem12_400(line)
interval_events
end

# What even is a 500 row?
#
# @param [String] line A single line in string format
# @param [Hash] _options
# @return [Hash] the line parsed into a hash of information
def parse_nem12_500(_line, _options = {}); end

# 900 is the last row a NEM12 should see...
#
# @param [String] line A single line in string format
# @param [Hash] _options
# @return [Hash] the line parsed into a hash of information
def parse_nem12_900(_line, _options = {}); end

Expand Down

0 comments on commit 6b6f18a

Please sign in to comment.