Class: Async::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/discorb/utils.rb

Instance Method Summary collapse

Instance Method Details

#description -> Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/discorb/utils.rb', line 19

def description
  @object_name ||= "#{self.class}:0x#{object_id.to_s(16)}#{@transient ? ' transient' : nil}"

  if @annotation
    "#{@object_name} #{@annotation}"
  elsif line = self.backtrace(0, 1)&.first
    "#{@object_name} #{line}"
  else
    @object_name
  end
end

#to_s -> Object Also known as: inspect



31
32
33
# File 'lib/discorb/utils.rb', line 31

def to_s
  "\#<#{self.description}>"
end