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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/eia/data.rb +9 -0
  3. data/lib/eia/version.rb +5 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 565c041ebd4637125406a245a1dd37308bebf32a
4
- data.tar.gz: 02827d9c2a55f2c35e96f99d0399cd1a44625020
3
+ metadata.gz: 78e56f078ce2b8fa4d7f3f8713c445b541f17cea
4
+ data.tar.gz: b910ec919b2afb31dfe25cce43b516343b4f6fd3
5
5
  SHA512:
6
- metadata.gz: d1d3c2ad80b88bb14f055f850c6cc067e75998f5d4fbd44a6eb33ece40c9e1e87c0b0c4b71e1ea9b6b73db471743521fe4976e5a481598aeb9454c105c19c3ef
7
- data.tar.gz: f04e8224f56a0779105325d1d3bccc0a8544ff45184dbcac5340c18cc87057406df7c7a96704975c5e64b03673bf8bddec0a563411b7273a4440cb3907215167
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.3"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - rCamposCruz