Class: Discorb::Embed::Field
- Inherits:
-
Entry
- Object
- Entry
- Discorb::Embed::Field
- Defined in:
- lib/discorb/embed.rb
Overview
Represents a field of embed.
Instance Attribute Summary collapse
-
#inline -> Boolean
Whether the field is inline.
-
#name -> String
The name of field.
-
#value -> String
The value of field.
Instance Method Summary collapse
-
#initialize(name, value, inline: true) -> Field
constructor
Initialize a new Field object.
-
#to_hash -> Hash
Convert field to hash.
Constructor Details
#initialize(name, value, inline: true) -> Field
Initialize a new Field object.
238 239 240 241 242 |
# File 'lib/discorb/embed.rb', line 238 def initialize(name, value, inline: true) @name = name @value = value @inline = inline end |
Instance Attribute Details
#inline -> Boolean
Returns Whether the field is inline.
229 230 231 |
# File 'lib/discorb/embed.rb', line 229 def inline @inline end |
#name -> String
Returns The name of field.
225 226 227 |
# File 'lib/discorb/embed.rb', line 225 def name @name end |
#value -> String
Returns The value of field.
227 228 229 |
# File 'lib/discorb/embed.rb', line 227 def value @value end |
Instance Method Details
#to_hash -> Hash
Convert field to hash.
251 252 253 254 255 256 257 |
# File 'lib/discorb/embed.rb', line 251 def to_hash { name: @name, value: @value, inline: @inline, } end |