lib/hanami/utils/basic_object.rb in hanami-utils-0.8.0 vs lib/hanami/utils/basic_object.rb in hanami-utils-0.9.0

- old
+ new

@@ -22,9 +22,31 @@ # @see http://ruby-doc.org/core/Object.html#method-i-inspect def inspect "#<#{self.class}:#{'%x' % (__id__ << 1)}#{__inspect}>" # rubocop:disable Style/FormatString end + # Alias for __id__ + # + # @return [Fixnum] the object id + # + # @since 0.9.0 + # + # @see http://ruby-doc.org/core/Object.html#method-i-object_id + def object_id + __id__ + end + + # Interface for <tt>pp</pp> + # + # @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 + end + # Returns true if responds to the given method. # # @return [TrueClass,FalseClass] the result of the check # # @since 0.3.5