Skip to content

Instantly share code, notes, and snippets.

@bestie
Last active February 29, 2016 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bestie/55e92f9f465d74ece2eb to your computer and use it in GitHub Desktop.
Save bestie/55e92f9f465d74ece2eb to your computer and use it in GitHub Desktop.
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
@bestie
Copy link
Author

bestie commented Feb 29, 2016

#to_proc So obvious!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment