Module: T::Props::PrettyPrintable

Includes:
Plugin
Included in:
Serializable
Defined in:
lib/types/props/pretty_printable.rb

Overview

typed: true

Defined Under Namespace

Modules: DecoratorMethods

Constant Summary

Constants included from Helpers

Helpers::Private

Instance Method Summary collapse

Methods included from Helpers

#abstract!, #final!, #interface!, #mixes_in_class_methods

Instance Method Details

#inspectObject

Return a string representation of this object and all of its props



8
9
10
# File 'lib/types/props/pretty_printable.rb', line 8

def inspect
  T.unsafe(T.cast(self, Object).class).decorator.inspect_instance(self)
end

#pretty_inspectObject

Override the PP gem with something that’s similar, but gives us a hook to do redaction



14
15
16
# File 'lib/types/props/pretty_printable.rb', line 14

def pretty_inspect
  T.unsafe(T.cast(self, Object).class).decorator.inspect_instance(self, multiline: true)
end