lib/hanami/utils/basic_object.rb in hanami-utils-1.1.0.beta1 vs lib/hanami/utils/basic_object.rb in hanami-utils-1.1.0.beta2
- old
+ new
@@ -19,11 +19,11 @@
#
# @since 0.3.5
#
# @see http://ruby-doc.org/core/Object.html#method-i-inspect
def inspect
- "#<#{self.class}:#{'%x' % (__id__ << 1)}#{__inspect}>" # rubocop:disable Style/FormatString
+ "#<#{self.class}:#{'0x0000%x' % (__id__ << 1)}#{__inspect}>" # rubocop:disable Style/FormatString
end
# Alias for __id__
#
# @return [Fixnum] the object id
@@ -35,16 +35,17 @@
__id__
end
# Interface for pp
#
+ # @param printer [PP] the Pretty Printable printer
# @return [String] the pretty-printable inspection of the object
#
# @since 0.9.0
#
# @see https://ruby-doc.org/stdlib/libdoc/pp/rdoc/PP.html
- def pretty_print(*)
- inspect
+ def pretty_print(printer)
+ printer.text(inspect)
end
# Returns true if responds to the given method.
#
# @return [TrueClass,FalseClass] the result of the check