Skip to content

Instantly share code, notes, and snippets.

@HamptonMakes
Created August 25, 2008 06:22
Show Gist options
  • Save HamptonMakes/7034 to your computer and use it in GitHub Desktop.
Save HamptonMakes/7034 to your computer and use it in GitHub Desktop.
if field.is_a? String
# Create a criteria parser
line, formatted_value = Searcher::Criteria.new(field, operator, value).matcher
formatted_values = [formatted_value]
elsif field.is_a? Proc
line, *formatted_values = field.call(*[value, operator, field][0...field.arity])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment