We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a766d1 commit fa25f7aCopy full SHA for fa25f7a
1 file changed
lib/matrix_sdk/util/extensions.rb
@@ -1,7 +1,5 @@
1
# frozen_string_literal: true
2
3
-require 'pp'
4
-
5
unless Object.respond_to? :yield_self
6
class Object
7
def yield_self
@@ -52,17 +50,19 @@ def event_initialize
52
50
end
53
51
54
def ignore_inspect(*symbols)
55
- class_eval %*
56
- include PP::ObjectMixin
+ require 'pp'
57
+ class_eval %*
58
def pretty_print_instance_variables
59
instance_variables
60
.reject { |f| %i[#{symbols.map { |s| "@#{s}" }.join ' '}].include? f }
61
.sort
62
63
64
def pretty_print(pp)
65
- pp.pp(self)
+ return pp.pp(self) if respond_to? :mocha_inspect
+
+ pp.pp_object(self)
66
67
68
alias inspect pretty_print_inspect
0 commit comments