Class: Rubycord::Webhooks::EmbedFooter
- Inherits:
-
Object
- Object
- Rubycord::Webhooks::EmbedFooter
- Defined in:
- lib/rubycord/webhooks/embeds.rb
Overview
An embed’s footer will be displayed at the very bottom of an embed, together with the timestamp. An icon URL can be set together with some text to be displayed.
Instance Attribute Summary collapse
-
#icon_url ⇒ String?
URL to an icon to be showed alongside the text.
-
#text ⇒ String?
Text to be displayed in the footer.
Instance Method Summary collapse
-
#initialize(text: nil, icon_url: nil) ⇒ EmbedFooter
constructor
Creates a new footer object.
-
#to_hash ⇒ Hash
A hash representation of this embed footer, to be converted to JSON.
Constructor Details
#initialize(text: nil, icon_url: nil) ⇒ EmbedFooter
Creates a new footer object.
134 135 136 137 |
# File 'lib/rubycord/webhooks/embeds.rb', line 134 def initialize(text: nil, icon_url: nil) @text = text @icon_url = icon_url end |
Instance Attribute Details
#icon_url ⇒ String?
Returns URL to an icon to be showed alongside the text.
129 130 131 |
# File 'lib/rubycord/webhooks/embeds.rb', line 129 def icon_url @icon_url end |
#text ⇒ String?
Returns text to be displayed in the footer.
126 127 128 |
# File 'lib/rubycord/webhooks/embeds.rb', line 126 def text @text end |
Instance Method Details
#to_hash ⇒ Hash
Returns a hash representation of this embed footer, to be converted to JSON.
140 141 142 143 144 145 |
# File 'lib/rubycord/webhooks/embeds.rb', line 140 def to_hash { text: @text, icon_url: @icon_url } end |