Skip to content

Instantly share code, notes, and snippets.

@banister
Created August 9, 2012 23:58
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 banister/3309285 to your computer and use it in GitHub Desktop.
Save banister/3309285 to your computer and use it in GitHub Desktop.
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