Module: RBS::Prototype::Runtime::Reflection

Defined in:
lib/rbs/prototype/runtime/reflection.rb,
sig/prototype/runtime.rbs

Class Method Summary collapse

Class Method Details

.constants_of(mod, inherit = true) ⇒ Array[Symbol]

Parameters:

  • mod (Module)
  • inherit (Boolean) (defaults to: true)

Returns:

  • (Array[Symbol])


12
13
14
15
# File 'lib/rbs/prototype/runtime/reflection.rb', line 12

def self.constants_of(mod, inherit = true)
  @constants_of ||= Module.instance_method(:constants)
  @constants_of.bind_call(mod, inherit)
end

.object_class(value) ⇒ Class

Parameters:

Returns:

  • (Class)


7
8
9
10
# File 'lib/rbs/prototype/runtime/reflection.rb', line 7

def self.object_class(value)
  @object_class ||= Object.instance_method(:class)
  @object_class.bind_call(value)
end