Class: Hanami::Utils::BasicObject
- Inherits:
- BasicObject
- Defined in:
- lib/hanami/utils/basic_object.rb
Overview
BasicObject
Direct Known Subclasses
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.
-
#inspect ⇒ String
Bare minimum inspect 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.
22 23 24 |
# File 'lib/hanami/utils/basic_object.rb', line 22 def self.const_missing(name) ::Object.const_get(name) end |
Instance Method Details
#class ⇒ Object
Returns the class for debugging purposes.
31 32 33 |
# File 'lib/hanami/utils/basic_object.rb', line 31 def class (class << self; self; end).superclass end |
#inspect ⇒ String
Bare minimum inspect for debugging purposes.
42 43 44 |
# File 'lib/hanami/utils/basic_object.rb', line 42 def inspect "#<#{self.class}:#{'0x0000%x' % (__id__ << 1)}#{__inspect}>" end |
#instance_of? ⇒ Object
59 |
# File 'lib/hanami/utils/basic_object.rb', line 59 define_method :instance_of?, ::Object.instance_method(:instance_of?) |
#is_a? ⇒ Object
74 |
# File 'lib/hanami/utils/basic_object.rb', line 74 define_method :is_a?, ::Object.instance_method(:is_a?) |
#kind_of? ⇒ Object
89 |
# File 'lib/hanami/utils/basic_object.rb', line 89 define_method :kind_of?, ::Object.instance_method(:kind_of?) |
#object_id ⇒ Fixnum
Alias for __id__
98 99 100 |
# File 'lib/hanami/utils/basic_object.rb', line 98 def object_id __id__ end |
#pretty_print(printer) ⇒ String
Interface for pp
110 111 112 |
# File 'lib/hanami/utils/basic_object.rb', line 110 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.
121 122 123 |
# File 'lib/hanami/utils/basic_object.rb', line 121 def respond_to?(method_name, include_all = false) respond_to_missing?(method_name, include_all) end |