modified Pry.view so that it uses 'inspect' for all objects. Now all evaluation output uses #inspect
This commit is contained in:
parent
53c52a46a9
commit
7a5947aa4b
|
@ -146,12 +146,7 @@ class Pry
|
||||||
# @param obj The object to view.
|
# @param obj The object to view.
|
||||||
# @return [String] The string representation of `obj`.
|
# @return [String] The string representation of `obj`.
|
||||||
def self.view(obj)
|
def self.view(obj)
|
||||||
case obj
|
obj.inspect
|
||||||
when String, Hash, Array, Symbol, Exception, nil
|
|
||||||
obj.inspect
|
|
||||||
else
|
|
||||||
obj.to_s
|
|
||||||
end
|
|
||||||
|
|
||||||
rescue NoMethodError
|
rescue NoMethodError
|
||||||
"unknown"
|
"unknown"
|
||||||
|
|
Loading…
Reference in New Issue