Skip to content

Instantly share code, notes, and snippets.

@kotay
Forked from mikecmpbll/plugins.rb
Created February 11, 2014 11:24
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 kotay/8933130 to your computer and use it in GitHub Desktop.
Save kotay/8933130 to your computer and use it in GitHub Desktop.
module Plugin1
hello("hello")
end
module PluginContainer
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
include Plugin1
end
end
class Greeter
def self.hello(name)
p "hello #{name}"
end
include PluginContainer
hello("from greeter")
end
# undefined method `hello' for Plugin1:Module (NoMethodError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment