quandl_data 1.3.3 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b218225ec95c6b4ab6d1a6aca2e0123c723cbc05
4
- data.tar.gz: 1b7650907d85479968f9e9ef5d53ff27476843df
3
+ metadata.gz: 08bf146b0c8eb0013154683227fb6490afbdcaca
4
+ data.tar.gz: a1d68b8e4933d8573dbe30bdd0bc591931ef4954
5
5
  SHA512:
6
- metadata.gz: f11b51e91b3f270084abe1e7e4c017b0ac1261db46bd4f6d3e574c83552f40990741cd4de08010894960317c4f70edb59dfe0c000c8ed37601b099b4e3a58a9b
7
- data.tar.gz: 8e3bf9e9cd563ab2e3a0798bf45ee240a75f8274be95c6d83c6839396121baca32584cdc84b01b7d05d8d18db6f50d01f103c1e3c743d3fc9ee37cf132f9d90d
6
+ metadata.gz: 31545591417716667defb90d4c2c34db0c31e484bd9d3cbd2762cf19ab3ff06d6a0a391ed2bc9163ab098f9864e27cfffbe56bc6f123733e45401997372662da
7
+ data.tar.gz: 90ad18560130551a978b37819dcba6ae14069fc336ce5d279c07f0f0e15d6e6fbeb1be4a786a222c1819ccb94490b9873c8bcecf4cd5c17a5e0a0b12e2ed4150
data/UPGRADE.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.3.4
2
+
3
+ * add #to_precision(Integer)
4
+ * fabricated data is forced to precision 14
5
+
6
+
1
7
  ## 1.3.3
2
8
 
3
9
  * integrate Babelfish.clean as part of Quandl::Data.clean method.
@@ -88,6 +88,10 @@ module Operations
88
88
  @data_array = Quandl::Operation::Sort.desc( data_array ); self
89
89
  end
90
90
 
91
+ def to_precision!(value)
92
+ @data_array = Quandl::Operation::Value.precision(data_array, value); self
93
+ end
94
+
91
95
  def row(*args)
92
96
  return @row if args[0].nil?
93
97
  @row = args[0]
@@ -130,6 +134,9 @@ module Operations
130
134
  self.class.new( data_array.dup, headers: headers, cleaned: cleaned )
131
135
  end
132
136
 
137
+ def to_precision(value)
138
+ clone.to_precision!(value)
139
+ end
133
140
  def to_jd
134
141
  clone.to_jd!
135
142
  end
@@ -1,5 +1,5 @@
1
1
  module Quandl
2
2
  class Data
3
- VERSION = "1.3.3"
3
+ VERSION = "1.3.4"
4
4
  end
5
5
  end
@@ -28,7 +28,7 @@ class Data
28
28
  data << row(index) unless nils
29
29
  index += 1
30
30
  end
31
- Quandl::Data.new( data ).sort_descending
31
+ Quandl::Data.new( data ).to_precision!(14).sort_descending
32
32
  end
33
33
 
34
34
  def row(index)
@@ -17,6 +17,13 @@ describe Quandl::Data::Operations do
17
17
  subject.limit(2).count.should eq 2
18
18
  end
19
19
 
20
+ describe "#to_precision" do
21
+ it "should set the precision" do
22
+ raw = '1998,10.293842930288591859035,1200.293842930288591859035'
23
+ Quandl::Data.new(raw).to_precision(6).to_date_str.should eq [["1998-12-31", 10.2938, 1200.29]]
24
+ end
25
+ end
26
+
20
27
  describe "#collapse=" do
21
28
 
22
29
  it "should collapse to monthly" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hilscher