Skip to content

Instantly share code, notes, and snippets.

@libryder
Created August 6, 2012 05:07
Show Gist options
  • Save libryder/3875cb1bfebc3cf3c1ea to your computer and use it in GitHub Desktop.
Save libryder/3875cb1bfebc3cf3c1ea to your computer and use it in GitHub Desktop.
cylon:module-test davidryder$ ruby my_shiny_module.rb
first module
module MyShinyModule
module FirstModule
def my_method
"first module"
end
end
end
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
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