hassox (owner)

Revisions

gist: 118633 Download_button fork
public
Public Clone URL: git://gist.github.com/118633.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module Foo
  def inherited(base)
    super
    puts "#{self} is inherited by #{base}"
  end
end
 
module Cracker
  def inherited(base)
    super
    puts "IN Cracker with #{base}"
  end
end
 
module Wobbles
  def inherited(base)
    super
    puts "IN Wobbles with #{base}"
  end
end
 
 
class Bar
  extend Foo
end
 
class Baz < Bar; end
class Paz < Baz; end
 
 
 
class Bob < Baz
  def self.inherited(base)
    super
    puts "In an overwritten inherited for #{self} to #{base}"
  end
end
 
class Bazza < Bob; end
class Dazza < Bazza; end
 
class Object
  extend Cracker
  extend Wobbles
end
 
class Gary < Dazza; end
class Tezza < String; end
 
class Glenda; end
 
class Col < Glenda; end