Class: ObjectForge::UnBasicObject Private
- Inherits:
- BasicObject
- Defined in:
- lib/object_forge/un_basic_object.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
BasicObject with a few common methods copied from Object.
Instance methods copied from Object collapse
- #class ⇒ Class
- #eql?(other) ⇒ Boolean
- #freeze ⇒ self
- #frozen? ⇒ Boolean
- #hash ⇒ Integer
- #inspect ⇒ String
- #is_a? ⇒ Boolean (also: #kind_of?)
- #respond_to?(symbol[, include_private]) ⇒ Boolean
- #to_s ⇒ String
Instance Method Summary collapse
-
#pretty_print ⇒ Object
Support for
pp(and IRB). -
#pretty_print_cycle ⇒ Object
Support for
pp(and IRB).
Instance Method Details
#class ⇒ Class
37 38 39 |
# File 'lib/object_forge/un_basic_object.rb', line 37 i[class eql? freeze frozen? hash inspect is_a? respond_to? to_s].each do |m| define_method(m, ::Object.instance_method(m)) end |
#eql?(other) ⇒ Boolean
37 38 39 |
# File 'lib/object_forge/un_basic_object.rb', line 37 i[class eql? freeze frozen? hash inspect is_a? respond_to? to_s].each do |m| define_method(m, ::Object.instance_method(m)) end |
#freeze ⇒ self
37 38 39 |
# File 'lib/object_forge/un_basic_object.rb', line 37 i[class eql? freeze frozen? hash inspect is_a? respond_to? to_s].each do |m| define_method(m, ::Object.instance_method(m)) end |
#frozen? ⇒ Boolean
37 38 39 |
# File 'lib/object_forge/un_basic_object.rb', line 37 i[class eql? freeze frozen? hash inspect is_a? respond_to? to_s].each do |m| define_method(m, ::Object.instance_method(m)) end |
#hash ⇒ Integer
37 38 39 |
# File 'lib/object_forge/un_basic_object.rb', line 37 i[class eql? freeze frozen? hash inspect is_a? respond_to? to_s].each do |m| define_method(m, ::Object.instance_method(m)) end |
#inspect ⇒ String
37 38 39 |
# File 'lib/object_forge/un_basic_object.rb', line 37 i[class eql? freeze frozen? hash inspect is_a? respond_to? to_s].each do |m| define_method(m, ::Object.instance_method(m)) end |
#is_a? ⇒ Boolean Also known as: kind_of?
37 38 39 |
# File 'lib/object_forge/un_basic_object.rb', line 37 i[class eql? freeze frozen? hash inspect is_a? respond_to? to_s].each do |m| define_method(m, ::Object.instance_method(m)) end |
#pretty_print ⇒ Object
Note:
This method dynamically calls UnboundMethod#bind_call, making it fairly slow.
Support for pp (and IRB).
51 52 53 54 55 |
# File 'lib/object_forge/un_basic_object.rb', line 51 def pretty_print(...) # We have to do it this way, instead of defining methods, # because Object#pretty_print does not exist without requiring "pp". ::Object.instance_method(:pretty_print).bind_call(self, ...) end |
#pretty_print_cycle ⇒ Object
Note:
This method dynamically calls UnboundMethod#bind_call, making it fairly slow.
Support for pp (and IRB).
58 59 60 61 62 63 |
# File 'lib/object_forge/un_basic_object.rb', line 58 def pretty_print_cycle(...) # See comment for #pretty_print. # :nocov: ::Object.instance_method(:pretty_print_cycle).bind_call(self, ...) # :nocov: end |
#respond_to?(symbol[, include_private]) ⇒ Boolean
37 38 39 |
# File 'lib/object_forge/un_basic_object.rb', line 37 i[class eql? freeze frozen? hash inspect is_a? respond_to? to_s].each do |m| define_method(m, ::Object.instance_method(m)) end |
#to_s ⇒ String
37 38 39 |
# File 'lib/object_forge/un_basic_object.rb', line 37 i[class eql? freeze frozen? hash inspect is_a? respond_to? to_s].each do |m| define_method(m, ::Object.instance_method(m)) end |