Class: MijDiscord::Data::EmbedMedia
- Inherits:
-
Object
- Object
- MijDiscord::Data::EmbedMedia
- Defined in:
- lib/mij-discord/data/embed.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#proxy_url ⇒ Object
readonly
Returns the value of attribute proxy_url.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(data) ⇒ EmbedMedia
constructor
A new instance of EmbedMedia.
- #inspect ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(data) ⇒ EmbedMedia
Returns a new instance of EmbedMedia.
138 139 140 141 |
# File 'lib/mij-discord/data/embed.rb', line 138 def initialize(data) @url, @width, @height = data['url'], data['width'], data['height'] @proxy_url = data['proxy_url'] end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
136 137 138 |
# File 'lib/mij-discord/data/embed.rb', line 136 def height @height end |
#proxy_url ⇒ Object (readonly)
Returns the value of attribute proxy_url.
132 133 134 |
# File 'lib/mij-discord/data/embed.rb', line 132 def proxy_url @proxy_url end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
130 131 132 |
# File 'lib/mij-discord/data/embed.rb', line 130 def url @url end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
134 135 136 |
# File 'lib/mij-discord/data/embed.rb', line 134 def width @width end |
Instance Method Details
#inspect ⇒ Object
143 144 145 |
# File 'lib/mij-discord/data/embed.rb', line 143 def inspect MijDiscord.make_inspect(self, :url, :width, :height) end |
#to_hash ⇒ Object
147 148 149 150 151 152 153 |
# File 'lib/mij-discord/data/embed.rb', line 147 def to_hash { 'url' => @url, 'width' => @width, 'height' => @height, }.delete_if {|_,v| v.nil? } end |