Class: MijDiscord::Data::Attachment
- Inherits:
-
Object
- Object
- MijDiscord::Data::Attachment
- Defined in:
- lib/mij-discord/data/message.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#proxy_url ⇒ Object
readonly
Returns the value of attribute proxy_url.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #image? ⇒ Boolean
-
#initialize(data, message) ⇒ Attachment
constructor
A new instance of Attachment.
Constructor Details
#initialize(data, message) ⇒ Attachment
Returns a new instance of Attachment.
190 191 192 193 194 195 196 |
# File 'lib/mij-discord/data/message.rb', line 190 def initialize(data, ) = @url, @proxy_url = data['url'], data['proxy_url'] @filename, @size = data['filename'], data['size'] @width, @height = data['width'], data['height'] end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
182 183 184 |
# File 'lib/mij-discord/data/message.rb', line 182 def filename @filename end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
188 189 190 |
# File 'lib/mij-discord/data/message.rb', line 188 def height @height end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
176 177 178 |
# File 'lib/mij-discord/data/message.rb', line 176 def end |
#proxy_url ⇒ Object (readonly)
Returns the value of attribute proxy_url.
180 181 182 |
# File 'lib/mij-discord/data/message.rb', line 180 def proxy_url @proxy_url end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
184 185 186 |
# File 'lib/mij-discord/data/message.rb', line 184 def size @size end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
178 179 180 |
# File 'lib/mij-discord/data/message.rb', line 178 def url @url end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
186 187 188 |
# File 'lib/mij-discord/data/message.rb', line 186 def width @width end |
Instance Method Details
#image? ⇒ Boolean
198 199 200 |
# File 'lib/mij-discord/data/message.rb', line 198 def image? !@width.nil? && !@height.nil? end |