Class: Rubycord::Webhooks::EmbedAuthor

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

Overview

An embed's author will be shown at the top to indicate who "authored" the particular event the webhook was sent for.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil, url: nil, icon_url: nil) ⇒ EmbedAuthor

Creates a new author object.



202
203
204
205
206
# File 'lib/rubycord/webhooks/embeds.rb', line 202

def initialize(name: nil, url: nil, icon_url: nil)
  @name = name
  @url = url
  @icon_url = icon_url
end

Instance Attribute Details

#icon_urlString?



196
197
198
# File 'lib/rubycord/webhooks/embeds.rb', line 196

def icon_url
  @icon_url
end

#nameString?



190
191
192
# File 'lib/rubycord/webhooks/embeds.rb', line 190

def name
  @name
end

#urlString?



193
194
195
# File 'lib/rubycord/webhooks/embeds.rb', line 193

def url
  @url
end

Instance Method Details

#to_hashHash



209
210
211
212
213
214
215
# File 'lib/rubycord/webhooks/embeds.rb', line 209

def to_hash
  {
    name: @name,
    url: @url,
    icon_url: @icon_url
  }
end