aemo 0.1.26 → 0.1.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aemo/market.rb +8 -1
- data/lib/aemo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1fd45c318e16565e909a6d11a72da6269d66378
|
4
|
+
data.tar.gz: 6fd484904e983d654a81a3432fe2c98b2f9f4b4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2574715d16d64abc06e9cf641685f8fd72f7b70bf4e38ff405d2611bf12fb3daa8d7cff57fdd9d504ea04e181115e4ef8ecfa02ffadc0fb1415267180aceeff6
|
7
|
+
data.tar.gz: e355c2c6a20ceb7f310f230c4dd8304aa54d7fd993b2e2095bd896c9fceaa0f012ea17f38be41cf29e62dc2705811bf43c3cb1cf7eb1ff85f4ea4bb4990ae9fe
|
data/lib/aemo/market.rb
CHANGED
@@ -23,7 +23,14 @@ module AEMO
|
|
23
23
|
values = []
|
24
24
|
if response.response.code == '200'
|
25
25
|
CSV.parse(response.body, :headers => true, :converters => :numeric) do |row|
|
26
|
-
row
|
26
|
+
puts "row(#{row.class})(respond_to?:#{row.respond_to?(:to_hash)}): #{row.inspect}"
|
27
|
+
if row.respond_to?(:to_h)
|
28
|
+
row = row.to_h
|
29
|
+
elsif row.respond_to?(:to_hash)
|
30
|
+
row = row.to_hash
|
31
|
+
else
|
32
|
+
raise NoMethodError, "cannot convert #{row.class} to Hash"
|
33
|
+
end
|
27
34
|
values.push AEMO::Market::Interval.new(row['SETTLEMENTDATE'],row)
|
28
35
|
end
|
29
36
|
end
|
data/lib/aemo/version.rb
CHANGED