quandl_operation 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,8 +20,17 @@ class Collapse
20
20
  Quandl::Logger.debug "#{self.name}.perform (#{t1.elapsed.microseconds}ms)"
21
21
  r
22
22
  end
23
+
24
+ def valid_collapse?(type)
25
+ valid_collapses.include?( type )
26
+ end
27
+
28
+ def valid_collapses
29
+ [ :daily, :weekly, :monthly, :quarterly, :annual ]
30
+ end
23
31
 
24
32
  def collapse(data, frequency)
33
+ return false unless valid_collapse?( type )
25
34
  # store the new collapsed data
26
35
  collapsed_data = {}
27
36
  range = find_end_of_range( data[0][0], frequency )
@@ -1,5 +1,5 @@
1
1
  module Quandl
2
2
  module Operation
3
- VERSION = "0.0.11"
3
+ VERSION = "0.0.12"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_operation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-10 00:00:00.000000000 Z
12
+ date: 2013-07-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake