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.
      17 18 19  | 
    
      # File 'lib/discorb/file.rb', line 17 def content_type @content_type end  | 
  
#filename -> String (readonly)
Returns The attachment filename.
      15 16 17  | 
    
      # File 'lib/discorb/file.rb', line 15 def filename @filename end  | 
  
#height -> Integer? (readonly)
      26 27 28  | 
    
      # File 'lib/discorb/file.rb', line 26 def height @height end  | 
  
#id -> Discorb::Snowflake (readonly)
Returns The attachment id.
      13 14 15  | 
    
      # File 'lib/discorb/file.rb', line 13 def id @id end  | 
  
#image? -> Boolean (readonly)
Returns whether the file is an image.
| 
       | 
    
      # File 'lib/discorb/file.rb', line 31
     | 
  
#io -> #read (readonly)
Returns The file content.
      11 12 13  | 
    
      # File 'lib/discorb/file.rb', line 11 def io @io end  | 
  
#proxy_url -> String (readonly)
Returns The attachment proxy url.
      23 24 25  | 
    
      # File 'lib/discorb/file.rb', line 23 def proxy_url @proxy_url end  | 
  
#size -> Integer (readonly)
Returns The attachment size in bytes.
      19 20 21  | 
    
      # File 'lib/discorb/file.rb', line 19 def size @size end  | 
  
#url -> String (readonly)
Returns The attachment url.
      21 22 23  | 
    
      # File 'lib/discorb/file.rb', line 21 def url @url end  | 
  
#width -> Integer? (readonly)
      29 30 31  | 
    
      # File 'lib/discorb/file.rb', line 29 def width @width end  |