-
-
Save libryder/3875cb1bfebc3cf3c1ea 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
cylon:module-test davidryder$ ruby my_shiny_module.rb | |
first module |
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 MyShinyModule | |
module FirstModule | |
def my_method | |
"first module" | |
end | |
end | |
end |
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
require './first_module.rb' | |
require './second_module.rb' | |
module MyShinyModule | |
def my_method | |
"the parent method" | |
end | |
end | |
include MyShinyModule | |
include MyShinyModule::FirstModule | |
puts my_method |
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 MyShinyModule | |
module SecondModule | |
def my_method | |
"second module" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment