eia 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eia/data.rb +9 -0
- data/lib/eia/version.rb +5 -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: 78e56f078ce2b8fa4d7f3f8713c445b541f17cea
|
4
|
+
data.tar.gz: b910ec919b2afb31dfe25cce43b516343b4f6fd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 638f03d3aebcf0c8172aade71a8c66f5e36d5c7f07d626fbf4b22dc1c33246ba88539fb17f73f97a42fccf5b66ae1e94dc0510e0d1744032d5157f6530cd7603
|
7
|
+
data.tar.gz: 8d9b12623b143a7df8480e26d9bbfb33188d2dba897ee0bd61e36e7c31180b9a17df9a1f15d9ac7720715a497eb09911ec558b0b7da2111421e49243b1c641f3
|
data/lib/eia/data.rb
CHANGED
@@ -57,6 +57,10 @@ class DataIBGE
|
|
57
57
|
return @value.to_f
|
58
58
|
end
|
59
59
|
|
60
|
+
def periodicity
|
61
|
+
return @periodicity
|
62
|
+
end
|
63
|
+
|
60
64
|
def is_valid?
|
61
65
|
if @table_code == '' or @table_code == nil or @table_code.to_i <= 0 then
|
62
66
|
puts "Invalid table code supplied. Value is #{@table_code}."
|
@@ -83,6 +87,11 @@ class DataIBGE
|
|
83
87
|
return false
|
84
88
|
end
|
85
89
|
|
90
|
+
if @periodicity == nil or @periodicity.to_i > 5 or @periodicity.to_i < 0 then
|
91
|
+
puts "Periodicity is invalid. Value is '#{@periodicity}'."
|
92
|
+
return false
|
93
|
+
end
|
94
|
+
|
86
95
|
if @value == '' or @value == nil then
|
87
96
|
puts "Value found is invalid. Value is '#{@value}'."
|
88
97
|
return false
|
data/lib/eia/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Eia
|
2
|
-
VERSION = "1.1.
|
2
|
+
VERSION = "1.1.4"
|
3
3
|
|
4
4
|
#Standard for version: xx.yy.zz
|
5
5
|
# xx - release
|
@@ -35,4 +35,8 @@ module Eia
|
|
35
35
|
# Version 1.1.3
|
36
36
|
# Another fixup on data classification and parsing.
|
37
37
|
|
38
|
+
# Version 1.1.4
|
39
|
+
# Adds getter for periodicity in data type, which I had forgot.
|
40
|
+
# Also adds periodicity to integrity verification.
|
41
|
+
|
38
42
|
end
|