Class: Discordrb::Webhooks::EmbedThumbnail

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/webhooks/embeds.rb

Overview

An embed's thumbnail will be displayed at the right of the message, next to the description and fields. When clicked it will point to the embed URL.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url: nil) ⇒ EmbedThumbnail

Creates a new thumbnail object.

Parameters:

  • url (String, nil) (defaults to: nil)

    The URL of the thumbnail.


169
170
171
# File 'lib/discordrb/webhooks/embeds.rb', line 169

def initialize(url: nil)
  @url = url
end

Instance Attribute Details

#urlString?

Returns URL of the thumbnail.

Returns:

  • (String, nil)

    URL of the thumbnail


165
166
167
# File 'lib/discordrb/webhooks/embeds.rb', line 165

def url
  @url
end

Instance Method Details

#to_hashHash

Returns a hash representation of this embed thumbnail, to be converted to JSON.

Returns:

  • (Hash)

    a hash representation of this embed thumbnail, to be converted to JSON.


174
175
176
177
178
# File 'lib/discordrb/webhooks/embeds.rb', line 174

def to_hash
  {
    url: @url
  }
end