Class: Discorb::DiscordModel Abstract

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

Overview

This class is abstract.

Represents Discord model.

Instance Method Summary collapse

Instance Method Details

#==(other) -> Object



22
23
24
25
26
27
28
# File 'lib/discorb/common.rb', line 22

def ==(other)
  if respond_to?(:id) && other.respond_to?(:id)
    id == other.id
  else
    super
  end
end

#eql?(other) -> Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/discorb/common.rb', line 18

def eql?(other)
  self == other
end

#inspect -> Object



30
31
32
# File 'lib/discorb/common.rb', line 30

def inspect
  "#<#{self.class}: #{@id}>"
end