Created
August 9, 2012 23:58
-
-
Save banister/3309285 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class BaseClass; end | |
class ChildClass < BaseClass | |
acts_as_content | |
end | |
class OtherChildClass < BaseClass; end | |
module ActsAsContent | |
def self.extended(base) | |
class << base | |
attr_accessor :acting_as_content | |
end | |
base.acting_as_content = false | |
end | |
def acts_as_content(options={}) | |
self.acting_as_content = true | |
end | |
end | |
BaseClass.extend ActsAsContent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment