class Discorb::Embed::Author

Represents an author of embed.

Attributes

icon[RW]

@return [String, nil] The icon url of author.

name[RW]

@return [String] The name of author.

url[RW]

@return [String, nil] The url of author.

Public Class Methods

new(name, url: nil, icon: nil) click to toggle source

Initialize a new Author object.

@param [String] name The name of author. @param [String] url The url of author. @param [String] icon The icon url of author.

# File lib/discorb/embed.rb, line 128
def initialize(name, url: nil, icon: nil)
  @name = name
  @url = url
  @icon = icon
end

Public Instance Methods

to_hash() click to toggle source

Convert author to hash.

@see discord.com/developers/docs/resources/channel#embed-object-embed-author-structure Offical Discord API Docs @return [Hash] Converted author.

# File lib/discorb/embed.rb, line 140
def to_hash
  {
    name: @name,
    url: @url,
    icon_url: @icon,
  }
end