Class: Rubycord::Webhooks::EmbedImage

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

Overview

An embed’s image will be displayed at the bottom, in large format. It will replace a footer icon URL if one is set.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url: nil) ⇒ EmbedImage

Creates a new image object.

Parameters:

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

    The URL of the image.



155
156
157
# File 'lib/rubycord/webhooks/embeds.rb', line 155

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

Instance Attribute Details

#urlString?

Returns URL of the image.

Returns:

  • (String, nil)

    URL of the image



151
152
153
# File 'lib/rubycord/webhooks/embeds.rb', line 151

def url
  @url
end

Instance Method Details

#to_hashHash

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

Returns:

  • (Hash)

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



160
161
162
163
164
# File 'lib/rubycord/webhooks/embeds.rb', line 160

def to_hash
  {
    url: @url
  }
end