Class: Discorb::UnicodeEmoji

Inherits:
Emoji
  • Object
show all
Defined in:
lib/discorb/emoji.rb

Overview

Represents a unicode emoji (default emoji) in discord.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Emoji

#==, #eql?

Instance Attribute Details

#name -> String (readonly)

Returns The name of the emoji. (e.g. :grinning:).

Returns:

  • (String)

    The name of the emoji. (e.g. :grinning:)



186
187
188
# File 'lib/discorb/emoji.rb', line 186

def name
  @name
end

#skin_tone -> Integer (readonly)

Returns The skin tone of the emoji.

Returns:

  • (Integer)

    The skin tone of the emoji.



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

def skin_tone
  @skin_tone
end

#value -> String (readonly)

Returns The unicode value of the emoji. (e.g. U+1F600).

Returns:

  • (String)

    The unicode value of the emoji. (e.g. U+1F600)



188
189
190
# File 'lib/discorb/emoji.rb', line 188

def value
  @value
end

Instance Method Details

#inspect -> Object



222
223
224
# File 'lib/discorb/emoji.rb', line 222

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

#to_s -> String

Returns The unicode string of the emoji.

Returns:

  • (String)

    The unicode string of the emoji.



209
210
211
# File 'lib/discorb/emoji.rb', line 209

def to_s
  @value
end

#to_uri -> String

Format the emoji for URI.

Returns:

  • (String)

    the formatted emoji.



218
219
220
# File 'lib/discorb/emoji.rb', line 218

def to_uri
  URI.encode_www_form_component(@value)
end