Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 6a4b5b7

Browse files
author
Rick Winfrey
committed
Use working example.rb file
1 parent ddcdcff commit 6a4b5b7

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module A
2+
CONST = 1
3+
def a; end
4+
end
5+
6+
module B
7+
include A
8+
9+
def b; end
10+
end
11+
12+
include B
13+
14+
C = Module.new do
15+
def c; end
16+
def b
17+
puts "c"
18+
end
19+
end
20+
21+
self.extend(C)
22+
23+
class D
24+
include C
25+
26+
def calling_a
27+
puts "calling a: #{a}"
28+
end
29+
30+
def calling_c
31+
puts "calling c: #{c}"
32+
end
33+
end
34+
35+
d = D.new
36+
d.b # => "c"

0 commit comments

Comments
 (0)