Class: ObjectForge::UnBasicObject Private

Inherits:
BasicObject
Defined in:
lib/object_forge/un_basic_object.rb,
sig/object_forge.rbs

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.

Since:

  • 0.1.0

Direct Known Subclasses

Crucible, ForgeDSL

Instance methods copied from Object collapse

Instance Method Summary collapse

Instance Method Details

#block_given?Boolean

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.

Returns:

  • (Boolean)

Since:

  • 0.1.0



292
# File 'sig/object_forge.rbs', line 292

def block_given?: -> bool

#classClass

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.

Returns:

  • (Class)

See Also:

  • Kernel#class

Since:

  • 0.1.0



37
38
39
# File 'lib/object_forge/un_basic_object.rb', line 37

%i[class eql? freeze frozen? hash inspect is_a? kind_of? respond_to? to_s].each do |m|
  define_method(m, ::Kernel.instance_method(m))
end

#eql?(other) ⇒ Boolean

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.

Parameters:

  • other (Object)

Returns:

  • (Boolean)

See Also:

  • Object#eql?

Since:

  • 0.1.0



37
38
39
# File 'lib/object_forge/un_basic_object.rb', line 37

%i[class eql? freeze frozen? hash inspect is_a? kind_of? respond_to? to_s].each do |m|
  define_method(m, ::Kernel.instance_method(m))
end

#freezeself

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.

Returns:

  • (self)

See Also:

  • Kernel#freeze

Since:

  • 0.1.0



37
38
39
# File 'lib/object_forge/un_basic_object.rb', line 37

%i[class eql? freeze frozen? hash inspect is_a? kind_of? respond_to? to_s].each do |m|
  define_method(m, ::Kernel.instance_method(m))
end

#frozen?Boolean

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.

Returns:

  • (Boolean)

See Also:

  • Kernel#frozen?

Since:

  • 0.1.0



37
38
39
# File 'lib/object_forge/un_basic_object.rb', line 37

%i[class eql? freeze frozen? hash inspect is_a? kind_of? respond_to? to_s].each do |m|
  define_method(m, ::Kernel.instance_method(m))
end

#hashInteger

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.

Returns:

  • (Integer)

See Also:

  • Object#hash

Since:

  • 0.1.0



37
38
39
# File 'lib/object_forge/un_basic_object.rb', line 37

%i[class eql? freeze frozen? hash inspect is_a? kind_of? respond_to? to_s].each do |m|
  define_method(m, ::Kernel.instance_method(m))
end

#inspectString

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.

Returns:

  • (String)

See Also:

  • Object#inspect

Since:

  • 0.1.0



37
38
39
# File 'lib/object_forge/un_basic_object.rb', line 37

%i[class eql? freeze frozen? hash inspect is_a? kind_of? respond_to? to_s].each do |m|
  define_method(m, ::Kernel.instance_method(m))
end

#is_a?Boolean

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.

Parameters:

  • klass (Module)

Returns:

  • (Boolean)

See Also:

  • Kernel#is_a?

Since:

  • 0.1.0



37
38
39
# File 'lib/object_forge/un_basic_object.rb', line 37

%i[class eql? freeze frozen? hash inspect is_a? kind_of? respond_to? to_s].each do |m|
  define_method(m, ::Kernel.instance_method(m))
end

#kind_of?Boolean

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.

Parameters:

  • klass (Module)

Returns:

  • (Boolean)

Since:

  • 0.1.0



280
# File 'sig/object_forge.rbs', line 280

def kind_of?: (Module klass) -> bool

#pretty_printvoid

Note:

This method dynamically calls UnboundMethod#bind_call, making it fairly slow.

This method returns an undefined value.

Support for pp (and IRB).

Parameters:

  • (PP)

Since:

  • 0.1.0



52
53
54
55
56
# File 'lib/object_forge/un_basic_object.rb', line 52

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_cyclevoid

Note:

This method dynamically calls UnboundMethod#bind_call, making it fairly slow.

This method returns an undefined value.

Support for pp (and IRB).

Parameters:

  • (PP)

Since:

  • 0.1.0



59
60
61
62
63
64
# File 'lib/object_forge/un_basic_object.rb', line 59

def pretty_print_cycle(...)
  # See comment for #pretty_print.
  # :nocov:
  ::Object.instance_method(:pretty_print_cycle).bind_call(self, ...)
  # :nocov:
end

#raisevoid

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.

This method returns an undefined value.

Parameters:

  • exception (_Exception)
  • message (String)
  • backtrace (Array[String])
  • cause: (_Exception)

Since:

  • 0.1.0



294
# File 'sig/object_forge.rbs', line 294

def raise: (_Exception exception, ?String message, ?Array[String] backtrace, ?cause: _Exception) -> void

#respond_to?(symbol[, include_private]) ⇒ Boolean

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.

Parameters:

  • name (Symbol)
  • include_all (Boolean)

Returns:

  • (Boolean)

See Also:

  • Object#respond_to?

Since:

  • 0.1.0



37
38
39
# File 'lib/object_forge/un_basic_object.rb', line 37

%i[class eql? freeze frozen? hash inspect is_a? kind_of? respond_to? to_s].each do |m|
  define_method(m, ::Kernel.instance_method(m))
end

#respond_to_missing?Boolean

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.

Parameters:

  • name (Symbol)
  • include_all (Boolean)

Returns:

  • (Boolean)

Since:

  • 0.1.0



296
# File 'sig/object_forge.rbs', line 296

def respond_to_missing?: (Symbol name, bool include_all) -> bool

#to_sString

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.

Returns:

  • (String)

See Also:

  • Object#to_s

Since:

  • 0.1.0



37
38
39
# File 'lib/object_forge/un_basic_object.rb', line 37

%i[class eql? freeze frozen? hash inspect is_a? kind_of? respond_to? to_s].each do |m|
  define_method(m, ::Kernel.instance_method(m))
end