Skip to content

Instantly share code, notes, and snippets.

@pjb3
Created September 14, 2010 13:38
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 pjb3/579041 to your computer and use it in GitHub Desktop.
Save pjb3/579041 to your computer and use it in GitHub Desktop.
module Finders
def find_like_objects
self.class.find(attributes)
end
end
module Utils
def self.included(cls)
cls.extend ClassMethods
end
module ClassMethods
def find(attributes)
"Utils.find"
end
end
extend ClassMethods
end
class Parent
attr_reader :attributes
end
class Foo < Parent
include Utils
include Finders
end
puts Foo.new.find_like_objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment