Module: LLM::Object::Kernel

Included in:
LLM::Object
Defined in:
lib/llm/object/kernel.rb

Constant Summary collapse

TypeError =
::TypeError

Instance Method Summary collapse

Instance Method Details

#classObject



46
47
48
# File 'lib/llm/object/kernel.rb', line 46

def class
  ::Kernel.instance_method(:class).bind(self).call
end

#extendObject



17
18
19
# File 'lib/llm/object/kernel.rb', line 17

def extend(...)
  ::Kernel.instance_method(:extend).bind(self).call(...)
end

#inspectObject Also known as: to_s



50
51
52
# File 'lib/llm/object/kernel.rb', line 50

def inspect
  "#<#{self.class}:0x#{object_id.to_s(16)} properties=#{to_h.inspect}>"
end

#instance_of?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/llm/object/kernel.rb', line 13

def instance_of?(...)
  ::Kernel.instance_method(:instance_of?).bind(self).call(...)
end

#kind_of?(klass) ⇒ Boolean Also known as: is_a?

Returns:

  • (Boolean)


25
26
27
# File 'lib/llm/object/kernel.rb', line 25

def kind_of?(klass)
  ::Kernel.instance_method(:kind_of?).bind(self).call(klass)
end

#methodObject



21
22
23
# File 'lib/llm/object/kernel.rb', line 21

def method(...)
  ::Kernel.instance_method(:method).bind(self).call(...)
end

#object_idObject



42
43
44
# File 'lib/llm/object/kernel.rb', line 42

def object_id
  ::Kernel.instance_method(:object_id).bind(self).call
end

#pretty_print(q) ⇒ Object



55
56
57
# File 'lib/llm/object/kernel.rb', line 55

def pretty_print(q)
  q.text(inspect)
end

#raiseObject



38
39
40
# File 'lib/llm/object/kernel.rb', line 38

def raise(...)
  ::Kernel.raise(...)
end

#respond_to?(m, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/llm/object/kernel.rb', line 30

def respond_to?(m, include_private = false)
  !!SINGLETON.key(@h, m) || self.class.method_defined?(m)
end

#respond_to_missing?(m, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/llm/object/kernel.rb', line 34

def respond_to_missing?(m, include_private = false)
  !!SINGLETON.key(@h, m)
end

#tapObject



9
10
11
# File 'lib/llm/object/kernel.rb', line 9

def tap(...)
  ::Kernel.instance_method(:tap).bind(self).call(...)
end