Last active
December 16, 2015 11:19
-
-
Save beakr/5426759 to your computer and use it in GitHub Desktop.
Defining modules without module declarations.
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 A; end | |
A::B = Module.new do | |
define_method :hello do | |
puts :hello | |
end | |
end | |
A::B::hello #=> hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment