Sha256: 318250fa4b9dae1741a3f7a1cedb65ac81b4c7ecd24b9e3d2228dbfbe05883b8

Contents?: true

Size: 561 Bytes

Versions: 2

Compression:

Stored size: 561 Bytes

Contents

# encoding: utf-8

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

2 entries across 2 versions & 1 rubygems

Version Path
rujitsu-0.5.0 lib/rujitsu/inspect.rb
rujitsu-0.4.0 lib/rujitsu/inspect.rb