quandl_cassinatra 0.1.10 → 0.1.11
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 321171d3425874e1162260fa7d05c1e596f3ee4a
|
4
|
+
data.tar.gz: 46359ab27a5299eaa1cf10bbb1c56a45b76f031b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8b2d1bcf69667cb2ac29cead3f0e15b52156518c7dfd22f60ec96a8354ec43a7c3f3f3065f4e14d0772d65638154e8e3b6b00a9868b099587a3be02d3a35c01
|
7
|
+
data.tar.gz: 67d46970e491418b852204319090e30308f8110b4c947737183b868f19bab286f307763f2945e584f6d325c4beee758588584e8fb197871c0c48a2d2bcdd4242
|
@@ -11,18 +11,8 @@ class Multiset
|
|
11
11
|
search_helper :to_dataset, -> { dataset }
|
12
12
|
search_helper :dataset, -> { find('multiset') }
|
13
13
|
|
14
|
-
search_scope :columns, ->(v){ where( columns:
|
14
|
+
search_scope :columns, ->(v){ where( columns: v ) }
|
15
15
|
|
16
|
-
search_helper :format_columns, ->(cols){
|
17
|
-
cols.split(',').collect do |column|
|
18
|
-
id_position = column.split('.')
|
19
|
-
id = id_position.first.to_i
|
20
|
-
position = id_position.last.to_i
|
21
|
-
position = position - 1 if position > 0
|
22
|
-
"#{id}.#{position}"
|
23
|
-
end.join(',')
|
24
|
-
}
|
25
|
-
|
26
16
|
attributes :id, :column_ids, :data
|
27
17
|
|
28
18
|
delegate :columns_count, :created_at, :frequency, :rows_count, :type, :updated_at, to: :dataset_attribute
|
@@ -6,15 +6,15 @@ describe Multiset do
|
|
6
6
|
let(:d2){ create(:dataset, data_table: Quandl::Data::Random.table( rows: 10, columns: 4, nils: false ) ) }
|
7
7
|
|
8
8
|
it "should retrieve the requested columns" do
|
9
|
-
m = Multiset.columns("#{d1.id.to_i}.
|
9
|
+
m = Multiset.columns("#{d1.id.to_i}.1,#{d2.id.to_i}.1").to_dataset
|
10
10
|
m.data_table[0][1].should eq d1.data_table[0][1]
|
11
11
|
m.data_table[0][2].should eq d2.data_table[0][1]
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should retrieve the requested columns" do
|
15
|
-
m = Multiset.columns("#{d2.id.to_i}.
|
16
|
-
m.data_table[0][1].should eq d2.data_table[0][
|
17
|
-
m.data_table[0][2].should eq d1.data_table[0][
|
15
|
+
m = Multiset.columns("#{d2.id.to_i}.2,#{d1.id.to_i}.2").to_dataset
|
16
|
+
m.data_table[0][1].should eq d2.data_table[0][2]
|
17
|
+
m.data_table[0][2].should eq d1.data_table[0][2]
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should be in the right order" do
|