Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 4e9fab373e
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (32 sloc) 0.536 kb
class BaseClass
def foo
puts "hi from baseclass"
end
end
module Begetter
def self.included(obj)
cls_name = obj.name + "Class"
newobj = Object.const_set cls_name, Class.new(::BaseClass)
newobj.send(:include, obj)
end
def bar
puts "calling baz"
baz
end
def initialize
puts "module initialize"
end
end
module Begetting
include Begetter
def baz
puts "hi from begetting"
end
def qux
puts "hi from qux"
end
end
obj = BegettingClass.new
obj.foo
obj.bar
obj.qux
Jump to Line
Something went wrong with that request. Please try again.