Class: Discorb::Embed::Footer

Inherits:
Entry
  • Object
show all
Defined in:
lib/discorb/embed.rb

Overview

Represemts a footer of embed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, icon: nil) -> Footer

Initialize a new Footer object.

Parameters:

  • text (String)

    The text of footer.

  • icon (String) (defaults to: nil)

    The icon url of footer.



200
201
202
203
# File 'lib/discorb/embed.rb', line 200

def initialize(text, icon: nil)
  @text = text
  @icon = icon
end

Instance Attribute Details

#icon -> Object

Returns the value of attribute icon.



192
193
194
# File 'lib/discorb/embed.rb', line 192

def icon
  @icon
end

#text -> Object

Returns the value of attribute text.



192
193
194
# File 'lib/discorb/embed.rb', line 192

def text
  @text
end

Instance Method Details

#to_hash -> Hash

Convert footer to hash.

Returns:

  • (Hash)

    Converted footer.

See Also:



212
213
214
215
216
217
# File 'lib/discorb/embed.rb', line 212

def to_hash
  {
    text: @text,
    icon_url: @icon,
  }
end