Class: Discorb::Embed::Field
- Inherits:
-
Object
- Object
- 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.
198 199 200 201 202 |
# File 'lib/discorb/embed.rb', line 198 def initialize(name, value, inline: true) @name = name @value = value @inline = inline end |
Instance Attribute Details
#inline -> Boolean
Returns Whether the field is inline.
189 190 191 |
# File 'lib/discorb/embed.rb', line 189 def inline @inline end |
#name -> String
Returns The name of field.
185 186 187 |
# File 'lib/discorb/embed.rb', line 185 def name @name end |
#value -> String
Returns The value of field.
187 188 189 |
# File 'lib/discorb/embed.rb', line 187 def value @value end |
Instance Method Details
#to_hash -> Hash
Convert field to hash.
210 211 212 213 214 215 216 |
# File 'lib/discorb/embed.rb', line 210 def to_hash { name: @name, value: @value, inline: @inline, } end |