Class: Dry::Core::BasicObject
- Inherits:
- BasicObject
- Defined in:
- lib/dry/core/basic_object.rb
Overview
BasicObject
Class Method Summary collapse
-
.const_missing(name) ⇒ Object, Module
private
Lookups constants at the top-level namespace, if they are missing in the current context.
Instance Method Summary collapse
-
#class ⇒ Object
Returns the class for debugging purposes.
- #instance_of? ⇒ Object
- #is_a? ⇒ Object
- #kind_of? ⇒ Object
-
#object_id ⇒ Fixnum
Alias for __id__.
-
#pretty_print(printer) ⇒ String
Interface for pp.
-
#respond_to?(method_name, include_all = false) ⇒ TrueClass, FalseClass
Returns true if responds to the given method.
Class Method Details
.const_missing(name) ⇒ Object, Module
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Lookups constants at the top-level namespace, if they are missing in the current context.
23 24 25 |
# File 'lib/dry/core/basic_object.rb', line 23 def self.const_missing(name) ::Object.const_get(name) end |
Instance Method Details
#class ⇒ Object
Returns the class for debugging purposes.
32 33 34 |
# File 'lib/dry/core/basic_object.rb', line 32 def class (class << self; self; end).superclass end |
#instance_of? ⇒ Object
62 |
# File 'lib/dry/core/basic_object.rb', line 62 define_method :instance_of?, ::Object.instance_method(:instance_of?) |
#is_a? ⇒ Object
77 |
# File 'lib/dry/core/basic_object.rb', line 77 define_method :is_a?, ::Object.instance_method(:is_a?) |
#kind_of? ⇒ Object
92 |
# File 'lib/dry/core/basic_object.rb', line 92 define_method :kind_of?, ::Object.instance_method(:kind_of?) |
#object_id ⇒ Fixnum
Alias for __id__
101 102 103 |
# File 'lib/dry/core/basic_object.rb', line 101 def object_id __id__ end |
#pretty_print(printer) ⇒ String
Interface for pp
113 114 115 |
# File 'lib/dry/core/basic_object.rb', line 113 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.
124 125 126 |
# 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 |