Skip to content

Instantly share code, notes, and snippets.

@stephenprater
Created July 14, 2011 21:05
Show Gist options
  • Save stephenprater/1083441 to your computer and use it in GitHub Desktop.
Save stephenprater/1083441 to your computer and use it in GitHub Desktop.
module Thing
module Constants
BOO = 2
end
module Methods
extend ActiveSupport::Concern
include Constants
module InstanceMethods
def boo
BOO
end
end
end
class Includify
include Methods
end
end
Thing::Includify.new.boo #=> unitialize Constant Thing::InstanceMethods::BOO
Thing::Methods.constants #=> [:InstanceMethods, :BOO]
module Thing
module Methods
extend ActiveSupport::Concern
BOO = 2
module InstanceMethods
def boo
BOO
end
end
end
class Includify
include Methods
end
end
Thing::Includify.new.boo #=> 2
Thing::Methods.constants #=> [:BOO, :InstanceMethods]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment