1
0
Fork 0
mirror of https://github.com/awesome-print/awesome_print synced 2023-03-27 23:22:34 -04:00
awesome_print/lib/ap/core_ext/method.rb

21 lines
557 B
Ruby
Raw Normal View History

2011-02-03 01:48:27 -05:00
# Copyright (c) 2010-2011 Michael Dvorkin
#
# Awesome Print is freely distributable under the terms of MIT license.
# See LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
#
# Method#name was intorduced in Ruby 1.8.7 so we define it here as necessary.
#
unless nil.method(:class).respond_to?(:name)
class Method
def name
inspect.split(/[#.>]/)[-1]
end
end
class UnboundMethod
def name
inspect.split(/[#.>]/)[-1]
end
end
end