Module | Kernel |
In: |
lib/prelude.rb
|
Method object for the caller of the currently executing method
# File lib/prelude.rb, line 118 118: def caller_method 119: name = (Kernel.caller[1] =~ /`([^']*)'/ and $1) 120: eval "self.method(\"#{name}\".to_sym)", binding 121: end
Shuts up Ruby’s warning.
# File lib/prelude.rb, line 124 124: def silence_warnings 125: old_verbose, $VERBOSE = $VERBOSE, nil 126: yield 127: ensure 128: $VERBOSE = old_verbose 129: end