Class: Discorb::Embed::Thumbnail
- Inherits:
-
Entry
- Object
- Entry
- Discorb::Embed::Thumbnail
- Defined in:
- lib/discorb/embed.rb
Overview
Represents a thumbnail of embed.
Instance Attribute Summary collapse
- #height ⇒ Integer? readonly
- #proxy_url ⇒ String? readonly
-
#url ⇒ String
The url of thumbnail.
- #width ⇒ Integer? readonly
Instance Method Summary collapse
-
#initialize(url) ⇒ Thumbnail
constructor
Initialize a new Thumbnail object.
-
#to_hash ⇒ Hash
Convert thumbnail to hash for sending.
Constructor Details
#initialize(url) ⇒ Thumbnail
Initialize a new Thumbnail object.
332 333 334 335 336 337 338 339 340 341 342 |
# File 'lib/discorb/embed.rb', line 332 def initialize(url) data = url if data.is_a? String @url = data else @url = data[:url] @proxy_url = data[:proxy_url] @height = data[:height] @width = data[:width] end end |
Instance Attribute Details
#height ⇒ Integer? (readonly)
322 323 324 |
# File 'lib/discorb/embed.rb', line 322 def height @height end |
#proxy_url ⇒ String? (readonly)
319 320 321 |
# File 'lib/discorb/embed.rb', line 319 def proxy_url @proxy_url end |
#url ⇒ String
Returns The url of thumbnail.
316 317 318 |
# File 'lib/discorb/embed.rb', line 316 def url @url end |
#width ⇒ Integer? (readonly)
325 326 327 |
# File 'lib/discorb/embed.rb', line 325 def width @width end |
Instance Method Details
#to_hash ⇒ Hash
Convert thumbnail to hash for sending.
351 352 353 |
# File 'lib/discorb/embed.rb', line 351 def to_hash { url: @url } end |