Class: Discordrb::Attachment
- Inherits:
-
Object
- Object
- Discordrb::Attachment
- Includes:
- IDObject
- Defined in:
- lib/discordrb/data.rb
Overview
An attachment to a message
Instance Attribute Summary collapse
-
#filename ⇒ String
readonly
The attachment's filename.
-
#height ⇒ Integer?
readonly
The height of an image file, in pixels, or nil if the file is not an image.
-
#message ⇒ Message
readonly
The message this attachment belongs to.
-
#proxy_url ⇒ String
readonly
The attachment's proxy URL - I'm not sure what exactly this does, but I think it has something to do with CDNs.
-
#size ⇒ Integer
readonly
The attachment's file size in bytes.
-
#url ⇒ String
readonly
The CDN URL this attachment can be downloaded at.
-
#width ⇒ Integer?
readonly
The width of an image file, in pixels, or nil if the file is not an image.
Attributes included from IDObject
Instance Method Summary collapse
-
#image? ⇒ true, false
Whether this file is an image file.
Methods included from IDObject
Instance Attribute Details
#filename ⇒ String (readonly)
1559 1560 1561 |
# File 'lib/discordrb/data.rb', line 1559 def filename @filename end |
#height ⇒ Integer? (readonly)
1568 1569 1570 |
# File 'lib/discordrb/data.rb', line 1568 def height @height end |
#message ⇒ Message (readonly)
1549 1550 1551 |
# File 'lib/discordrb/data.rb', line 1549 def end |
#proxy_url ⇒ String (readonly)
1556 1557 1558 |
# File 'lib/discordrb/data.rb', line 1556 def proxy_url @proxy_url end |
#size ⇒ Integer (readonly)
1562 1563 1564 |
# File 'lib/discordrb/data.rb', line 1562 def size @size end |
#url ⇒ String (readonly)
1552 1553 1554 |
# File 'lib/discordrb/data.rb', line 1552 def url @url end |
#width ⇒ Integer? (readonly)
1565 1566 1567 |
# File 'lib/discordrb/data.rb', line 1565 def width @width end |
Instance Method Details
#image? ⇒ true, false
1586 1587 1588 |
# File 'lib/discordrb/data.rb', line 1586 def image? !(@width.nil? || @height.nil?) end |