Class: Discorb::PartialEmoji

Inherits:
DiscordModel show all
Defined in:
lib/discorb/emoji.rb

Overview

Represents a partial custom emoji in discord.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DiscordModel

#==, #eql?

Instance Attribute Details

#deleted -> Boolean (readonly) Also known as: deleted?

Returns Whether the emoji is deleted.

Returns:

  • (Boolean)

    Whether the emoji is deleted.



170
171
172
# File 'lib/discorb/emoji.rb', line 170

def deleted
  @deleted
end

#id -> Discorb::Snowflake (readonly)

Returns The ID of the emoji.

Returns:



166
167
168
# File 'lib/discorb/emoji.rb', line 166

def id
  @id
end

#name -> String (readonly)

Returns The name of the emoji.

Returns:

  • (String)

    The name of the emoji.



168
169
170
# File 'lib/discorb/emoji.rb', line 168

def name
  @name
end

Instance Method Details

#inspect -> Object



195
196
197
# File 'lib/discorb/emoji.rb', line 195

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

#to_s -> String

Format the emoji for sending.

Returns:

  • (String)

    the formatted emoji.



204
205
206
# File 'lib/discorb/emoji.rb', line 204

def to_s
  "<#{@animated ? "a" : ""}:#{@name}:#{@id}>"
end

#to_uri -> String

Format the emoji for URI.

Returns:

  • (String)

    the formatted emoji.



191
192
193
# File 'lib/discorb/emoji.rb', line 191

def to_uri
  "#{@name}:#{@id}"
end