Class: Discordrb::Webhooks::EmbedField

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/webhooks/embeds.rb

Overview

A field is a small block of text with a header that can be relatively freely layouted with other fields.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil, value: nil, inline: false) ⇒ EmbedField

Creates a new field object.



235
236
237
238
239
# File 'lib/discordrb/webhooks/embeds.rb', line 235

def initialize(name: nil, value: nil, inline: false)
  @name = name
  @value = value
  @inline = inline
end

Instance Attribute Details

#inlinetrue, false



229
230
231
# File 'lib/discordrb/webhooks/embeds.rb', line 229

def inline
  @inline
end

#nameString?



223
224
225
# File 'lib/discordrb/webhooks/embeds.rb', line 223

def name
  @name
end

#valueString?



226
227
228
# File 'lib/discordrb/webhooks/embeds.rb', line 226

def value
  @value
end

Instance Method Details

#to_hashHash



242
243
244
245
246
247
248
# File 'lib/discordrb/webhooks/embeds.rb', line 242

def to_hash
  {
    name: @name,
    value: @value,
    inline: @inline
  }
end