Skip to content

Instantly share code, notes, and snippets.

@banister
Forked from johnbender/val.rb
Created March 12, 2009 04:23
Show Gist options
  • Save banister/77902 to your computer and use it in GitHub Desktop.
Save banister/77902 to your computer and use it in GitHub Desktop.
class PostQuery < Query
@@clauses = [:columns, :operations, :order]
def initialize(target_object)
super(target_object, @@clauses)
@clauses.each do |c|
class << self; self; end.define_method(c) { self[c] }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment