Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module A
- def self.init_on(target)
- target.foo = 123
- end
- end
- $base_module = A
- module Test
- C = Struct.new(:id) do
- include $base_module
- @@base = $base_module
- def initialize
- @@base.init_on(self)
- end
- attr_accessor :foo
- end
- end
- c = Test::C.new
- puts c.foo
Add Comment
Please, Sign In to add comment