Class: Discorb::Embed::Image
- Inherits:
-
Entry
- Object
- Entry
- Discorb::Embed::Image
- Defined in:
- lib/discorb/embed.rb
Overview
Represents an image of embed.
Instance Attribute Summary collapse
- #height -> Integer? readonly
- #proxy_url -> String? readonly
-
#url -> String
The url of image.
- #width -> Integer? readonly
Instance Method Summary collapse
-
#initialize(url) -> Image
constructor
Initialize a new Image object.
-
#to_hash -> Hash
Convert image to hash for sending.
Constructor Details
#initialize(url) -> Image
Initialize a new Image object.
280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/discorb/embed.rb', line 280 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)
270 271 272 |
# File 'lib/discorb/embed.rb', line 270 def height @height end |
#proxy_url -> String? (readonly)
267 268 269 |
# File 'lib/discorb/embed.rb', line 267 def proxy_url @proxy_url end |
#url -> String
Returns The url of image.
264 265 266 |
# File 'lib/discorb/embed.rb', line 264 def url @url end |
#width -> Integer? (readonly)
273 274 275 |
# File 'lib/discorb/embed.rb', line 273 def width @width end |
Instance Method Details
#to_hash -> Hash
Convert image to hash for sending.
299 300 301 |
# File 'lib/discorb/embed.rb', line 299 def to_hash { url: @url } end |