ranged_find 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/dreamer3/ranged_find.rb +3 -3
  2. metadata +3 -3
@@ -1,7 +1,7 @@
1
1
  module Dreamer3 # :nodoc:
2
2
  module RangedFind # :nodoc:
3
3
 
4
- DATE_RANGES={
4
+ DATE_RANGES= lambda {{
5
5
  # daily
6
6
  :yesterday => [ Time.zone.now.yesterday.midnight, 1.day ],
7
7
  :today => [ Time.zone.now.midnight, 1.day ],
@@ -14,7 +14,7 @@ module Dreamer3 # :nodoc:
14
14
  :last_month => [ Time.zone.now.prev_month.beginning_of_month, 1.month ],
15
15
  :this_month => [ Time.zone.now.beginning_of_month, 1.month ],
16
16
  :next_month => [ Time.zone.now.next_month.beginning_of_month, 1.month ],
17
- }
17
+ }}
18
18
 
19
19
  module ClassMethods
20
20
 
@@ -32,7 +32,7 @@ module Dreamer3 # :nodoc:
32
32
  if time_range.is_a?(Range)
33
33
  conditions << time_range.begin
34
34
  conditions << time_range.end
35
- elsif range=DATE_RANGES[time_range]
35
+ elsif range=DATE_RANGES.call[time_range]
36
36
  conditions << range.first
37
37
  conditions << (range.last===Time ? range.last : range.first + range.last)
38
38
  else
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ranged_find
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
9
- version: "0.1"
8
+ - 2
9
+ version: "0.2"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Josh Goebel