Class: Discordrb::Webhooks::EmbedAuthor
- Inherits:
-
Object
- Object
- Discordrb::Webhooks::EmbedAuthor
- Defined in:
- lib/discordrb/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
-
#icon_url ⇒ String?
URL of the icon to be displayed next to the author.
-
#name ⇒ String?
Name of the author.
-
#url ⇒ String?
URL the name should link to.
Instance Method Summary collapse
-
#initialize(name: nil, url: nil, icon_url: nil) ⇒ EmbedAuthor
constructor
Creates a new author object.
-
#to_hash ⇒ Hash
A hash representation of this embed author, to be converted to JSON.
Constructor Details
#initialize(name: nil, url: nil, icon_url: nil) ⇒ EmbedAuthor
Creates a new author object.
204 205 206 207 208 |
# File 'lib/discordrb/webhooks/embeds.rb', line 204 def initialize(name: nil, url: nil, icon_url: nil) @name = name @url = url @icon_url = icon_url end |
Instance Attribute Details
#icon_url ⇒ String?
Returns URL of the icon to be displayed next to the author.
198 199 200 |
# File 'lib/discordrb/webhooks/embeds.rb', line 198 def icon_url @icon_url end |
#name ⇒ String?
Returns name of the author.
192 193 194 |
# File 'lib/discordrb/webhooks/embeds.rb', line 192 def name @name end |
#url ⇒ String?
Returns URL the name should link to.
195 196 197 |
# File 'lib/discordrb/webhooks/embeds.rb', line 195 def url @url end |
Instance Method Details
#to_hash ⇒ Hash
Returns a hash representation of this embed author, to be converted to JSON.
211 212 213 214 215 216 217 |
# File 'lib/discordrb/webhooks/embeds.rb', line 211 def to_hash { name: @name, url: @url, icon_url: @icon_url } end |