Created
September 14, 2010 13:38
-
-
Save pjb3/579041 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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