Class: MijDiscord::Data::EmbedField
- Inherits:
-
Object
- Object
- MijDiscord::Data::EmbedField
- Defined in:
- lib/mij-discord/data/embed.rb
Instance Attribute Summary collapse
-
#inline ⇒ Object
readonly
Returns the value of attribute inline.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(data) ⇒ EmbedField
constructor
A new instance of EmbedField.
- #inspect ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(data) ⇒ EmbedField
Returns a new instance of EmbedField.
211 212 213 |
# File 'lib/mij-discord/data/embed.rb', line 211 def initialize(data) @name, @value, @inline = data['name'], data['value'], data['inline'] end |
Instance Attribute Details
#inline ⇒ Object (readonly)
Returns the value of attribute inline.
209 210 211 |
# File 'lib/mij-discord/data/embed.rb', line 209 def inline @inline end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
205 206 207 |
# File 'lib/mij-discord/data/embed.rb', line 205 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
207 208 209 |
# File 'lib/mij-discord/data/embed.rb', line 207 def value @value end |
Instance Method Details
#inspect ⇒ Object
215 216 217 |
# File 'lib/mij-discord/data/embed.rb', line 215 def inspect MijDiscord.make_inspect(self, :name, :value, :inline) end |
#to_hash ⇒ Object
219 220 221 222 223 224 225 |
# File 'lib/mij-discord/data/embed.rb', line 219 def to_hash { 'name' => @name, 'value' => @value, 'inline' => @inline, }.delete_if {|_,v| v.nil? } end |