We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1dc2a40 commit edd6c30Copy full SHA for edd6c30
1 file changed
lib/irb/color_printer.rb
@@ -4,7 +4,6 @@
4
5
module IRB
6
class ColorPrinter < ::PP
7
- METHOD_IS_A = Object.instance_method(:is_a?)
8
METHOD_RESPOND_TO = Object.instance_method(:respond_to?)
9
METHOD_INSPECT = Object.instance_method(:inspect)
10
@@ -26,7 +25,7 @@ def screen_width
26
25
end
27
28
def pp(obj)
29
- if METHOD_IS_A.bind(obj).call(String)
+ if String === obj
30
# Avoid calling Ruby 2.4+ String#pretty_print that splits a string by "\n"
31
text(obj.inspect)
32
elsif !METHOD_RESPOND_TO.bind(obj).call(:inspect)
0 commit comments