Skip to content

Commit

Permalink
Merge pull request #66 from rossta/recurrence_include_doc
Browse files Browse the repository at this point in the history
Document Recurrence#include?
  • Loading branch information
rossta committed Nov 21, 2016
2 parents 6f44f5e + 97ce2ac commit 276e88c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/montrose/recurrence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ def inspect
"#<#{self.class}:#{object_id.to_s(16)} #{to_h.inspect}>"
end

# Return true/false if given timestamp equals a
# timestamp given by the recurrence
#
# @return [Boolean] timestamp is included in recurrence
#
def include?(timestamp)
event_enum.lazy.each do |event|
return true if event == timestamp
Expand Down

0 comments on commit 276e88c

Please sign in to comment.