Skip to content

Instantly share code, notes, and snippets.

@liangzan
Created September 24, 2010 07:39
Show Gist options
  • Save liangzan/595000 to your computer and use it in GitHub Desktop.
Save liangzan/595000 to your computer and use it in GitHub Desktop.
# lib/searchlogic/core_ext/object.rb
def searchlogic_lambda(type = :string, options = {}, &block)
proc = lambda(&block)
proc.searchlogic_options ||= {}
proc.searchlogic_options[:type] = type
proc.searchlogic_options.merge!(options)
proc
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment