Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module A
- end
- module B
- end
- module A::A1
- module_function
- def test
- puts "hola"
- end
- end
- module A::A2
- module_function
- def test2
- A1.test
- end
- end
- module B
- module B1
- module_function
- def test
- puts "bolas"
- end
- end
- end
- module B
- module B2
- module_function
- def test2
- B1.test
- end
- end
- end
- B::B2.test2 # => "bolas"
- A::A2.test2 # => NameError: uninitialized constant A::A2::A1
Add Comment
Please, Sign In to add comment