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



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

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

#eql?(other) -> Boolean

Returns:

  • (Boolean)


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

def eql?(other)
  self == other
end

#inspect -> Object



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

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