Class: Discorb::Embed::Author
- Inherits:
 - 
      Object
      
        
- Object
 - Discorb::Embed::Author
 
 
- Defined in:
 - lib/discorb/embed.rb
 
Overview
Represents an author of embed.
Instance Attribute Summary collapse
- 
  
    
      #icon -> String? 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
The icon url of author.
 - 
  
    
      #name -> String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
The name of author.
 - 
  
    
      #url -> String? 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
The url of author.
 
Instance Method Summary collapse
- 
  
    
      #initialize(name, url: nil, icon: nil) -> Author 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Initialize a new Author object.
 - 
  
    
      #to_hash -> Hash 
    
    
  
  
  
  
  
  
  
  
  
    
Convert author to hash.
 
Constructor Details
#initialize(name, url: nil, icon: nil) -> Author
Initialize a new Author object.
      128 129 130 131 132  | 
    
      # File 'lib/discorb/embed.rb', line 128 def initialize(name, url: nil, icon: nil) @name = name @url = url @icon = icon end  | 
  
Instance Attribute Details
#icon -> String?
Returns The icon url of author.
      119 120 121  | 
    
      # File 'lib/discorb/embed.rb', line 119 def icon @icon end  | 
  
#name -> String
Returns The name of author.
      115 116 117  | 
    
      # File 'lib/discorb/embed.rb', line 115 def name @name end  | 
  
#url -> String?
Returns The url of author.
      117 118 119  | 
    
      # File 'lib/discorb/embed.rb', line 117 def url @url end  | 
  
Instance Method Details
#to_hash -> Hash
Convert author to hash.
      140 141 142 143 144 145 146  | 
    
      # File 'lib/discorb/embed.rb', line 140 def to_hash { name: @name, url: @url, icon_url: @icon, } end  |