quandl_cassinatra 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/UPGRADE.md +5 -0
- data/lib/quandl/cassinatra/model/dataset.rb +7 -3
- data/lib/quandl/cassinatra/version.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- metadata +1 -1
data/UPGRADE.md
CHANGED
@@ -9,7 +9,7 @@ class Dataset
|
|
9
9
|
include Concerns::Properties
|
10
10
|
include Searchable
|
11
11
|
|
12
|
-
attributes :id, :
|
12
|
+
attributes :id, :data, :trim_start, :trim_end, :columns
|
13
13
|
|
14
14
|
delegate :columns_count, :created_at, :frequency, :rows_count, :type, :updated_at, to: :dataset_attribute
|
15
15
|
|
@@ -21,6 +21,10 @@ class Dataset
|
|
21
21
|
@column_names ||= columns.collect{|c| c['name'] }
|
22
22
|
end
|
23
23
|
|
24
|
+
def column_ids
|
25
|
+
@column_ids ||= columns.collect{|c| c['id'] }
|
26
|
+
end
|
27
|
+
|
24
28
|
def data_table
|
25
29
|
@data_table ||= Data::Table.new( self.data || [] )
|
26
30
|
end
|
@@ -38,12 +42,12 @@ class Dataset
|
|
38
42
|
end
|
39
43
|
|
40
44
|
def delete_data
|
41
|
-
Dataset.
|
45
|
+
Dataset.destroy_existing("#{id.to_i}/data").status
|
42
46
|
end
|
43
47
|
|
44
48
|
def delete_rows(*dates)
|
45
49
|
query = { dates: Array(dates).flatten }.to_query
|
46
|
-
Dataset.
|
50
|
+
Dataset.destroy_existing("#{id.to_i}/data/rows?#{query}").status
|
47
51
|
end
|
48
52
|
|
49
53
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -13,6 +13,6 @@ end
|
|
13
13
|
|
14
14
|
require "quandl/fabricate"
|
15
15
|
require "quandl/cassinatra"
|
16
|
-
|
17
|
-
Quandl::Cassinatra.use 'http://localhost:9292/'
|
16
|
+
Quandl::Cassinatra.use 'http://192.168.33.10:8983/wikiposit_cassandra/'
|
17
|
+
# Quandl::Cassinatra.use 'http://localhost:9292/'
|
18
18
|
include Quandl::Cassinatra
|