class Dry::Core::BasicObject
@since 0.8.0
Public Class Methods
Lookups constants at the top-level namespace, if they are missing in the current context.
@param name [Symbol] the constant name
@return [Object, Module] the constant
@raise [NameError] if the constant cannot be found
@since 0.8.0 @api private
@see ruby-doc.org/core/Module.html#method-i-const_missing
# File lib/dry/core/basic_object.rb, line 23 def self.const_missing(name) ::Object.const_get(name) end
Public Instance Methods
Returns the class for debugging purposes.
@since 0.8.0
@see ruby-doc.org/core/Object.html#method-i-class
# File lib/dry/core/basic_object.rb, line 32 def class (class << self; self; end).superclass end
Alias for __id__
@return [Fixnum] the object id
@since 0.8.0
@see ruby-doc.org/core/Object.html#method-i-object_id
# File lib/dry/core/basic_object.rb, line 101 def object_id __id__ end
Interface for pp
@param printer [PP] the Pretty Printable printer @return [String] the pretty-printable inspection of the object
@since 0.8.0
@see ruby-doc.org/stdlib/libdoc/pp/rdoc/PP.html
# File lib/dry/core/basic_object.rb, line 113 def pretty_print(printer) printer.text(inspect) end
Returns true if responds to the given method.
@return [TrueClass,FalseClass] the result of the check
@since 0.8.0
@see ruby-doc.org/core/Object.html#method-i-respond_to-3F
# File lib/dry/core/basic_object.rb, line 124 def respond_to?(method_name, include_all = false) # rubocop:disable Style/OptionalBooleanParameter respond_to_missing?(method_name, include_all) end
Private Instance Methods
@since 0.8.0 @api private
# File lib/dry/core/basic_object.rb, line 140 def __inspect # rubocop:disable Style/EmptyMethod end
Must be overridden by descendants
@since 0.8.0 @api private
# File lib/dry/core/basic_object.rb, line 134 def respond_to_missing?(_method_name, _include_all) ::Kernel.raise ::NotImplementedError end