Class: Hanami::Utils::BasicObject
- Inherits:
- BasicObject
- Defined in:
- lib/hanami/utils/basic_object.rb
Overview
BasicObject
Direct Known Subclasses
Instance Method Summary collapse
-
#class ⇒ Object
Return 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.
Instance Method Details
#class ⇒ Object
Return the class for debugging purposes.
12 13 14 |
# File 'lib/hanami/utils/basic_object.rb', line 12 def class (class << self; self; end).superclass end |
#inspect ⇒ String
Bare minimum inspect for debugging purposes.
rubocop:disable Style/FormatString rubocop:disable Style/FormatStringToken
26 27 28 |
# File 'lib/hanami/utils/basic_object.rb', line 26 def inspect "#<#{self.class}:#{'0x0000%x' % (__id__ << 1)}#{__inspect}>" end |
#instance_of? ⇒ Object
45 |
# File 'lib/hanami/utils/basic_object.rb', line 45 define_method :instance_of?, ::Object.instance_method(:instance_of?) |
#is_a? ⇒ Object
60 |
# File 'lib/hanami/utils/basic_object.rb', line 60 define_method :is_a?, ::Object.instance_method(:is_a?) |
#kind_of? ⇒ Object
75 |
# File 'lib/hanami/utils/basic_object.rb', line 75 define_method :kind_of?, ::Object.instance_method(:kind_of?) |
#object_id ⇒ Fixnum
Alias for __id__
84 85 86 |
# File 'lib/hanami/utils/basic_object.rb', line 84 def object_id __id__ end |
#pretty_print(printer) ⇒ String
Interface for pp
96 97 98 |
# File 'lib/hanami/utils/basic_object.rb', line 96 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.
107 108 109 |
# File 'lib/hanami/utils/basic_object.rb', line 107 def respond_to?(method_name, include_all = false) respond_to_missing?(method_name, include_all) end |