Created
July 6, 2016 02:41
-
-
Save jcsky/c213ede4f78b67ea2ab82381193fe2b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Dojo | |
A = "Dojo - A" | |
B = "Dojo - B" | |
class Dojo_child | |
def print_a | |
p "Dojo_child print_a - A: #{A}" | |
end | |
end | |
module Kata | |
A = "Kata - A" | |
class Kata_child | |
def print_b | |
p "kata_child print_b - B: #{B}" | |
end | |
end | |
module Roulette | |
A = "Roulette - A" | |
B = "Roulette - B" | |
class Roulette_child | |
def print_b | |
p "Roulette_child print_b - B: #{B}" | |
end | |
end | |
class ScopeIn | |
def push | |
p "A: #{A}" | |
p "B: #{B}" | |
Roulette_child.new.print_b | |
Kata_child.new.print_b | |
Dojo_child.new.print_a | |
end | |
end | |
end | |
end | |
end | |
Dojo::Kata::Roulette::ScopeIn.new.push | |
# output | |
# "A: Roulette - A" | |
# "B: Roulette - B" | |
# "Roulette_child print_b - B: Roulette - B" | |
# "kata_child print_b - B: Dojo - B" | |
# "Dojo_child print_a - A: Dojo - A" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment