Module: Sorbet::Private::RealStdlib

Defined in:
lib/real_stdlib.rb

Overview

typed: true

Class Method Summary collapse

Class Method Details

.real_ancestors(mod) ⇒ Object



25
26
27
28
# File 'lib/real_stdlib.rb', line 25

def self.real_ancestors(mod)
  @real_ancestors ||= Module.instance_method(:ancestors)
  @real_ancestors.bind(mod).call
end

.real_autoload?(o, klass) ⇒ Boolean

Returns:

  • (Boolean)


70
71
72
73
# File 'lib/real_stdlib.rb', line 70

def self.real_autoload?(o, klass)
  @real_autoload ||= Object.instance_method(:autoload?)
  @real_autoload.bind(o).call(klass)
end

.real_const_get(obj, const, arg) ⇒ Object



75
76
77
78
# File 'lib/real_stdlib.rb', line 75

def self.real_const_get(obj, const, arg)
  @real_const_get ||= Object.singleton_class.instance_method(:const_get)
  @real_const_get.bind(obj).call(const, arg)
end

.real_constants(mod) ⇒ Object



10
11
12
13
# File 'lib/real_stdlib.rb', line 10

def self.real_constants(mod)
  @real_constants ||= Module.instance_method(:constants)
  @real_constants.bind(mod).call(false)
end

.real_eqeq(obj, other) ⇒ Object



65
66
67
68
# File 'lib/real_stdlib.rb', line 65

def self.real_eqeq(obj, other)
  @real_eqeq ||= Object.instance_method(:==)
  @real_eqeq.bind(obj).call(other)
end

.real_hash(o) ⇒ Object



55
56
57
58
# File 'lib/real_stdlib.rb', line 55

def self.real_hash(o)
  @real_hash ||= Object.instance_method(:hash)
  @real_hash.bind(o).call
end

.real_instance_methods(mod, arg) ⇒ Object



30
31
32
33
# File 'lib/real_stdlib.rb', line 30

def self.real_instance_methods(mod, arg)
  @real_instance_methods ||= Module.instance_method(:instance_methods)
  @real_instance_methods.bind(mod).call(arg)
end

.real_is_a?(o, klass) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/real_stdlib.rb', line 5

def self.real_is_a?(o, klass)
  @real_is_a ||= Object.instance_method(:is_a?)
  @real_is_a.bind(o).call(klass)
end

.real_name(o) ⇒ Object



20
21
22
23
# File 'lib/real_stdlib.rb', line 20

def self.real_name(o)
  @real_name ||= Module.instance_method(:name)
  @real_name.bind(o).call
end

.real_object_id(o) ⇒ Object



15
16
17
18
# File 'lib/real_stdlib.rb', line 15

def self.real_object_id(o)
  @real_object_id ||= Object.instance_method(:object_id)
  @real_object_id.bind(o).call
end

.real_private_instance_methods(mod, arg) ⇒ Object



40
41
42
43
# File 'lib/real_stdlib.rb', line 40

def self.real_private_instance_methods(mod, arg)
  @real_private_instance_methods ||= Module.instance_method(:private_instance_methods)
  @real_private_instance_methods.bind(mod).call(arg)
end

.real_singleton_class(obj) ⇒ Object



45
46
47
48
# File 'lib/real_stdlib.rb', line 45

def self.real_singleton_class(obj)
  @real_singleton_class ||= Object.instance_method(:singleton_class)
  @real_singleton_class.bind(obj).call
end

.real_singleton_methods(mod, arg) ⇒ Object



35
36
37
38
# File 'lib/real_stdlib.rb', line 35

def self.real_singleton_methods(mod, arg)
  @real_singleton_methods ||= Module.instance_method(:singleton_methods)
  @real_singleton_methods.bind(mod).call(arg)
end

.real_spaceship(obj, arg) ⇒ Object



50
51
52
53
# File 'lib/real_stdlib.rb', line 50

def self.real_spaceship(obj, arg)
  @real_spaceship ||= Object.instance_method(:<=>)
  @real_spaceship.bind(obj).call(arg)
end

.real_superclass(o) ⇒ Object



60
61
62
63
# File 'lib/real_stdlib.rb', line 60

def self.real_superclass(o)
  @real_superclass ||= Class.instance_method(:superclass)
  @real_superclass.bind(o).call
end