Skip to content

Instantly share code, notes, and snippets.

@beakr
Last active December 16, 2015 11:19
Show Gist options
  • Save beakr/5426759 to your computer and use it in GitHub Desktop.
Save beakr/5426759 to your computer and use it in GitHub Desktop.
Defining modules without module declarations.
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