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



17
18
19
20
21
22
23
# File 'lib/discorb/common.rb', line 17

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

#eql?(other) -> Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/discorb/common.rb', line 13

def eql?(other)
  self == other
end

#hash -> Object



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

def hash
  @id.hash
end