Class: Discorb::ForumChannel::Tag
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- Discorb::ForumChannel::Tag
- Defined in:
- lib/discorb/channel/forum.rb
Overview
Represents a tag in the forum channel.
Instance Attribute Summary collapse
-
#emoji -> Discorb::Emoji
readonly
The emoji of the tag.
-
#id -> Snowflake
readonly
The id of the tag.
-
#moderated -> Boolean
(also: #moderated?)
readonly
Whether the tag is moderated.
-
#name -> String
readonly
The name of the tag.
Instance Method Summary collapse
-
#initialize(name, emoji, moderated: false) -> Discorb::ForumChannel::Tag
constructor
Initializes a new tag.
- #inspect -> Object
-
#to_hash -> Hash
Returns the tag as a hash.
Methods inherited from DiscordModel
Constructor Details
#initialize(name, emoji, moderated: false) -> Discorb::ForumChannel::Tag
Initializes a new tag.
63 64 65 66 67 68 |
# File 'lib/discorb/channel/forum.rb', line 63 def initialize(name, emoji, moderated: false) @id = nil @name = name @emoji = emoji @moderated = moderated end |
Instance Attribute Details
#emoji -> Discorb::Emoji (readonly)
Returns The emoji of the tag.
52 53 54 |
# File 'lib/discorb/channel/forum.rb', line 52 def emoji @emoji end |
#id -> Snowflake (readonly)
Returns The id of the tag.
45 46 47 |
# File 'lib/discorb/channel/forum.rb', line 45 def id @id end |
#moderated -> Boolean (readonly) Also known as: moderated?
Returns Whether the tag is moderated. (aka moderator only).
49 50 51 |
# File 'lib/discorb/channel/forum.rb', line 49 def moderated @moderated end |
#name -> String (readonly)
Returns The name of the tag.
47 48 49 |
# File 'lib/discorb/channel/forum.rb', line 47 def name @name end |
Instance Method Details
#inspect -> Object
86 87 88 |
# File 'lib/discorb/channel/forum.rb', line 86 def inspect "#<#{self.class}: #{name} id=#{id}>" end |
#to_hash -> Hash
Returns the tag as a hash.
75 76 77 |
# File 'lib/discorb/channel/forum.rb', line 75 def to_hash { id: id, name: name, moderated: moderated, emoji: emoji } end |