quandl_data 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/quandl/data/table/operations.rb +12 -2
- data/lib/quandl/data/version.rb +1 -1
- data/quandl_data.gemspec +1 -1
- metadata +3 -3
@@ -53,17 +53,27 @@ module Operations
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def trim_start(date)
|
56
|
+
# date format
|
56
57
|
date = Date.parse(date) if date.is_a?(String)
|
57
58
|
date = date.jd if date.respond_to?(:jd)
|
59
|
+
# find index
|
58
60
|
index = data_array.rindex{|r| r[0] == date }
|
59
|
-
|
61
|
+
# trim if index is valid
|
62
|
+
@data_array = @data_array[index..-1] if @data_array[index]
|
63
|
+
# chainable
|
64
|
+
self
|
60
65
|
end
|
61
66
|
|
62
67
|
def trim_end(date)
|
68
|
+
# date format
|
63
69
|
date = Date.parse(date) if date.is_a?(String)
|
64
70
|
date = date.jd if date.respond_to?(:jd)
|
71
|
+
# find index
|
65
72
|
index = data_array.rindex{|r| r[0] == date }
|
66
|
-
|
73
|
+
# trim if index is valid
|
74
|
+
@data_array = @data_array[0..index] if @data_array[index]
|
75
|
+
# chainable
|
76
|
+
self
|
67
77
|
end
|
68
78
|
|
69
79
|
def limit(amount)
|
data/lib/quandl/data/version.rb
CHANGED
data/quandl_data.gemspec
CHANGED
@@ -22,5 +22,5 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_development_dependency "fivemat", "~> 1.2"
|
23
23
|
|
24
24
|
s.add_runtime_dependency "activesupport", ">= 3.0.0"
|
25
|
-
s.add_runtime_dependency "quandl_operation", ">= 0.0.
|
25
|
+
s.add_runtime_dependency "quandl_operation", ">= 0.0.16"
|
26
26
|
end
|
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: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
requirements:
|
83
83
|
- - '>='
|
84
84
|
- !ruby/object:Gem::Version
|
85
|
-
version: 0.0.
|
85
|
+
version: 0.0.16
|
86
86
|
type: :runtime
|
87
87
|
prerelease: false
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - '>='
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 0.0.
|
93
|
+
version: 0.0.16
|
94
94
|
description: Data will be interfaced
|
95
95
|
email:
|
96
96
|
- blake@hilscher.ca
|