Created
January 13, 2014 18:49
-
-
Save dnch/8405789 to your computer and use it in GitHub Desktop.
So, Ruby 2.1 lets you do interesting things...
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
#!/usr/bin/env ruby -w | |
class Derp | |
@exportable = [] | |
class << self | |
def exportable(meth) | |
@exportable << meth | |
end | |
def exportable_methods | |
@exportable | |
end | |
end | |
exportable def something | |
"foon" | |
end | |
end | |
puts Derp.exportable_methods | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment