Sha256: acc9a4d72c97f5c59ee74c493ae81bcc0621e58330cb302d61d64babc7828afc
Contents?: true
Size: 545 Bytes
Versions: 5
Compression:
Stored size: 545 Bytes
Contents
module Kernel # If output is true then echo's, # else just returns the name def _cmd output=false caller[0] =~ /`([^']*)'/ output ? p($1) : $1 end private :_cmd end module ExtendObject # Outputs all methods not inherited from Object def simple_methods self.methods.sort - Object.methods end # Matches your search string against all # methods and returns array def grep_method match match = /#{match}/ unless match.is_a? Regexp self.methods.grep(match) end end Object.send(:include, ExtendObject)
Version data entries
5 entries across 5 versions & 2 rubygems