Class: Discorb::Channel Abstract
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- Discorb::Channel
- Defined in:
- lib/discorb/channel.rb
Overview
This class is abstract.
Represents a channel of Discord.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id -> Discorb::Snowflake
readonly
The ID of the channel.
-
#name -> String
readonly
The name of the channel.
Instance Method Summary collapse
-
#==(other) -> Boolean
Checks if the channel is other channel.
- #inspect -> Object
- #type -> Object
Methods inherited from DiscordModel
Instance Attribute Details
#id -> Discorb::Snowflake (readonly)
Returns The ID of the channel.
12 13 14 |
# File 'lib/discorb/channel.rb', line 12 def id @id end |
#name -> String (readonly)
Returns The name of the channel.
14 15 16 |
# File 'lib/discorb/channel.rb', line 14 def name @name end |
Instance Method Details
#==(other) -> Boolean
Checks if the channel is other channel.
40 41 42 43 44 |
# File 'lib/discorb/channel.rb', line 40 def ==(other) return false unless other.respond_to?(:id) @id == other.id end |
#inspect -> Object
46 47 48 |
# File 'lib/discorb/channel.rb', line 46 def inspect "#<#{self.class} \"##{@name}\" id=#{@id}>" end |
#type -> Object
82 83 84 |
# File 'lib/discorb/channel.rb', line 82 def type self.class.channel_type end |