Skip to content

Commit 820f397

Browse files
authored
Merge pull request ice-cube-ruby#344 from aquach/fix-incorrect-variable-name
Fix incorrect variable name in previous_occurrences.
2 parents 8098e08 + 033f425 commit 820f397

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ice_cube/schedule.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ def next_occurrence(from = nil, options = {})
181181

182182
# The previous occurrence from a given time
183183
def previous_occurrence(from)
184-
from = TimeUtil.match_zone(from, start_time) or raise ArgumentError, "Time required, got #{time.inspect}"
184+
from = TimeUtil.match_zone(from, start_time) or raise ArgumentError, "Time required, got #{from.inspect}"
185185
return nil if from <= start_time
186186
enumerate_occurrences(start_time, from - 1).to_a.last
187187
end
188188

189189
# The previous n occurrences before a given time
190190
def previous_occurrences(num, from)
191-
from = TimeUtil.match_zone(from, start_time) or raise ArgumentError, "Time required, got #{time.inspect}"
191+
from = TimeUtil.match_zone(from, start_time) or raise ArgumentError, "Time required, got #{from.inspect}"
192192
return [] if from <= start_time
193193
a = enumerate_occurrences(start_time, from - 1).to_a
194194
a.size > num ? a[-1*num,a.size] : a

0 commit comments

Comments
 (0)