Skip to content

Instantly share code, notes, and snippets.

@dnch
Created January 13, 2014 18:49
Show Gist options
  • Save dnch/8405789 to your computer and use it in GitHub Desktop.
Save dnch/8405789 to your computer and use it in GitHub Desktop.
So, Ruby 2.1 lets you do interesting things...
#!/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