Class: Discorb::Embed::Image
- Inherits:
-
Object
- Object
- 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.
244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/discorb/embed.rb', line 244 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)
234 235 236 |
# File 'lib/discorb/embed.rb', line 234 def height @height end |
#proxy_url -> String? (readonly)
231 232 233 |
# File 'lib/discorb/embed.rb', line 231 def proxy_url @proxy_url end |
#url -> String
Returns The url of image.
228 229 230 |
# File 'lib/discorb/embed.rb', line 228 def url @url end |
#width -> Integer? (readonly)
237 238 239 |
# File 'lib/discorb/embed.rb', line 237 def width @width end |
Instance Method Details
#to_hash -> Hash
Convert image to hash for sending.
262 263 264 |
# File 'lib/discorb/embed.rb', line 262 def to_hash { url: @url } end |