Class: MijDiscord::Data::EmbedProvider
- Inherits:
-
Object
- Object
- MijDiscord::Data::EmbedProvider
- Defined in:
- lib/mij-discord/data/embed.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(data) ⇒ EmbedProvider
constructor
A new instance of EmbedProvider.
- #inspect ⇒ Object
- #to_hash ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
184 185 186 |
# File 'lib/mij-discord/data/embed.rb', line 184 def name @name end |
#url ⇒ Object (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
#inspect ⇒ Object
192 193 194 |
# File 'lib/mij-discord/data/embed.rb', line 192 def inspect MijDiscord.make_inspect(self, :name, :url) end |
#to_hash ⇒ Object
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 |