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



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

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

#eql?(other) -> Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/discorb/common.rb', line 16

def eql?(other)
  self == other
end

#hash -> Object



33
34
35
# File 'lib/discorb/common.rb', line 33

def hash
  @id.hash
end