Class: DiscordWebHooks::Embed

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

Instance Method Summary collapse

Constructor Details

#initialize(title: "", description: "", color: 000000, author: {}, fields: [], footer: "", timestamp: "") ⇒ Embed

Returns a new instance of Embed.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/discord_webhooks/embed.rb', line 3

def initialize(title:"",description:"",color:000000,author:{},fields:[],footer:"",timestamp:"")
  @title = title
  @description = description
  @color = color
  @author = author
  @fields = fields
  @footer = footer
  @timestamp = timestamp

  @hash = {
    title: @title,
    description: @description,
    color: @color,
    author: @author,
    fields: @fields,
    footer: @footer,
    timestamp: @timestamp
  }
end

Instance Method Details

#to_hObject



23
24
25
# File 'lib/discord_webhooks/embed.rb', line 23

def to_h
  @hash
end