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 9d34580 commit ebe2b26Copy full SHA for ebe2b26
src/main/ruby/core/proc.rb
@@ -86,18 +86,14 @@ def f.binding
86
end
87
88
def to_s
89
- sl = source_location
90
- return super if sl.nil?
91
- file, line = sl
92
-
93
- l = ' (lambda)' if lambda?
94
- if file and line
95
- "#<#{self.class}:0x#{self.object_id.to_s(16)}@#{file}:#{line}#{l}>".force_encoding('ASCII-8BIT')
96
- else
97
- "#<#{self.class}:0x#{self.object_id.to_s(16)}#{l}>".force_encoding('ASCII-8BIT')
98
- end
99
+ base = super()
+ file, line = source_location
100
+ suffix = "".b
+ suffix << "@#{file}:#{line}" if file and line
+ suffix << ' (lambda)' if lambda?
+ base.b.insert -2, suffix
+ end
101
alias_method :inspect, :to_s
102
103
def to_proc
0 commit comments