Skip to content

Instantly share code, notes, and snippets.

@vincentp
Created January 28, 2010 09:39
Show Gist options
  • Select an option

  • Save vincentp/288584 to your computer and use it in GitHub Desktop.

Select an option

Save vincentp/288584 to your computer and use it in GitHub Desktop.
acts_as_something : pattern to extend class
module ActsAsSomething
def self.included(base)
base.extend ActMethods
end
module ActMethods
def acts_as_something
extend ClassMethods
include InstanceMethods
end
end
module InstanceMethods
def my_instance_method
end
end
module ClassMethods
def my_class_method
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment