Class: MijDiscord::Data::EmbedProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/mij-discord/data/embed.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ EmbedProvider

Returns a new instance of EmbedProvider.



188
189
190
# File 'lib/mij-discord/data/embed.rb', line 188

def initialize(data)
  @name, @url = data['name'], data['url']
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



184
185
186
# File 'lib/mij-discord/data/embed.rb', line 184

def name
  @name
end

#urlObject (readonly)

Returns the value of attribute url.



186
187
188
# File 'lib/mij-discord/data/embed.rb', line 186

def url
  @url
end

Instance Method Details

#inspectObject



192
193
194
# File 'lib/mij-discord/data/embed.rb', line 192

def inspect
  MijDiscord.make_inspect(self, :name, :url)
end

#to_hashObject



196
197
198
199
200
201
# File 'lib/mij-discord/data/embed.rb', line 196

def to_hash
  {
    'name' => @name,
    'url' => @url,
  }.delete_if {|_,v| v.nil? }
end