Created
August 20, 2014 20:51
-
-
Save dennisfaust/725e81aa02ea2a9f90e7 to your computer and use it in GitHub Desktop.
Ruby: Use a method directly from a module...
This file contains hidden or 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 Moddy | |
def show_me | |
puts "Yop" | |
end | |
end | |
Class.new.extend(Moddy).show_me | |
Yop | |
# this may come in handy also: | |
# require Dir.pwd+'path_to_module' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment