Class: Hanami::Utils::BasicObject

Inherits:
BasicObject
Defined in:
gems/gems/hanami-utils-1.3.0/lib/hanami/utils/basic_object.rb

Overview

BasicObject

Since:

  • 0.3.5

Instance Method Summary collapse

Instance Method Details

#classObject

Return the class for debugging purposes.

def class
  (class << self; self; end).superclass
end

#inspectString

Bare minimum inspect for debugging purposes.

rubocop:disable Style/FormatString rubocop:disable Style/FormatStringToken

Returns:

  • (String)

    the inspect string

See Also:

Since:

  • 0.3.5

def inspect
  "#<#{self.class}:#{'0x0000%x' % (__id__ << 1)}#{__inspect}>"
end

#object_idFixnum

Alias for id

Returns:

  • (Fixnum)

    the object id

See Also:

Since:

  • 0.9.0

def object_id
  __id__
end

#pretty_print(printer) ⇒ String

Interface for pp

Parameters:

  • printer (PP)

    the Pretty Printable printer

Returns:

  • (String)

    the pretty-printable inspection of the object

See Also:

Since:

  • 0.9.0

def pretty_print(printer)
  printer.text(inspect)
end

#respond_to?(method_name, include_all = false) ⇒ TrueClass, FalseClass

Returns true if responds to the given method.

Returns:

  • (TrueClass, FalseClass)

    the result of the check

See Also:

Since:

  • 0.3.5

def respond_to?(method_name, include_all = false)
  respond_to_missing?(method_name, include_all)
end