Class: Discorb::Attachment
- Inherits:
-
DiscordModel
- Object
- DiscordModel
- Discorb::Attachment
- Defined in:
- lib/discorb/file.rb
Overview
Represents a attachment file.
Instance Attribute Summary collapse
-
#content_type -> String
readonly
The attachment content type.
-
#filename -> String
readonly
The attachment filename.
- #height -> Integer? readonly
-
#id -> Discorb::Snowflake
readonly
The attachment id.
-
#image? -> Boolean
readonly
Whether the file is an image.
-
#io -> #read
readonly
The file content.
-
#proxy_url -> String
readonly
The attachment proxy url.
-
#size -> Integer
readonly
The attachment size in bytes.
-
#url -> String
readonly
The attachment url.
- #width -> Integer? readonly
Method Summary
Methods inherited from DiscordModel
Instance Attribute Details
#content_type -> String (readonly)
Returns The attachment content type.
18 19 20 |
# File 'lib/discorb/file.rb', line 18 def content_type @content_type end |
#filename -> String (readonly)
Returns The attachment filename.
16 17 18 |
# File 'lib/discorb/file.rb', line 16 def filename @filename end |
#height -> Integer? (readonly)
27 28 29 |
# File 'lib/discorb/file.rb', line 27 def height @height end |
#id -> Discorb::Snowflake (readonly)
Returns The attachment id.
14 15 16 |
# File 'lib/discorb/file.rb', line 14 def id @id end |
#image? -> Boolean (readonly)
Returns whether the file is an image.
|
# File 'lib/discorb/file.rb', line 32
|
#io -> #read (readonly)
Returns The file content.
12 13 14 |
# File 'lib/discorb/file.rb', line 12 def io @io end |
#proxy_url -> String (readonly)
Returns The attachment proxy url.
24 25 26 |
# File 'lib/discorb/file.rb', line 24 def proxy_url @proxy_url end |
#size -> Integer (readonly)
Returns The attachment size in bytes.
20 21 22 |
# File 'lib/discorb/file.rb', line 20 def size @size end |
#url -> String (readonly)
Returns The attachment url.
22 23 24 |
# File 'lib/discorb/file.rb', line 22 def url @url end |
#width -> Integer? (readonly)
30 31 32 |
# File 'lib/discorb/file.rb', line 30 def width @width end |