Skip to content

Instantly share code, notes, and snippets.

@rosylilly
Created July 6, 2009 07:50
Show Gist options
  • Save rosylilly/141322 to your computer and use it in GitHub Desktop.
Save rosylilly/141322 to your computer and use it in GitHub Desktop.
class Object
def self_methods
methods.map{|m|
m=method(m.to_sym)
(m.owner == self.class ? m.name : nil )
}.compact
end
end
p ''.methods.sort
p ''.self_methods.sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment