Last active
February 29, 2016 15:09
-
-
Save bestie/55e92f9f465d74ece2eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DateRangeFilter | |
def self.to_proc | |
->(constraint, events) { new(constraint, events).call }.to_proc | |
end | |
def initialize(constraint, events) | |
@constraint = constraint | |
@events = events | |
end | |
def call | |
intersects_with_range?(constraint, other) | |
end | |
private | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#to_proc
So obvious!