Class: Discorb::Embed::Thumbnail
- Inherits:
-
Object
- Object
- 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.
288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/discorb/embed.rb', line 288 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)
278 279 280 |
# File 'lib/discorb/embed.rb', line 278 def height @height end |
#proxy_url -> String? (readonly)
275 276 277 |
# File 'lib/discorb/embed.rb', line 275 def proxy_url @proxy_url end |
#url -> String
Returns The url of thumbnail.
272 273 274 |
# File 'lib/discorb/embed.rb', line 272 def url @url end |
#width -> Integer? (readonly)
281 282 283 |
# File 'lib/discorb/embed.rb', line 281 def width @width end |
Instance Method Details
#to_hash -> Hash
Convert thumbnail to hash for sending.
306 307 308 |
# File 'lib/discorb/embed.rb', line 306 def to_hash { url: @url } end |