Created
September 13, 2012 23:49
-
-
Save bricker/3718692 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
module Concern | |
def modname | |
self.name | |
end | |
end | |
module Validation | |
extend Concern | |
module EventValidation; end | |
end | |
def show_modname(mod) | |
mod.modname rescue "modname undefined for #{mod}" | |
end | |
puts show_modname(Validation) #=> "Validation" | |
puts show_modname(Validation::EventValidation) #=> "modname undefined for EventValidation" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment