Skip to content

Instantly share code, notes, and snippets.

@tosch
Created February 11, 2010 12:55
Show Gist options
  • Save tosch/301475 to your computer and use it in GitHub Desktop.
Save tosch/301475 to your computer and use it in GitHub Desktop.
module Ruote
class StorageParticipant
def query ( criterion, *args )
method = :"by_#{criterion}"
raise ArgumentError.new('no valid query criterion') unless self.respond_to?(method)
self.send(method, *args)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment