Class: Twitch::V2::Images
- Inherits:
-
Object
- Object
- Twitch::V2::Images
- Defined in:
- lib/kappa/images.rb
Overview
A group of URLs pointing to variously-sized versions of the same image.
Instance Attribute Summary collapse
-
#large_url ⇒ String
readonly
URL for the large-sized version of this image.
-
#medium_url ⇒ String
readonly
URL for the medium-sized version of this image.
-
#small_url ⇒ String
readonly
URL for the small-sized version of this image.
-
#template_url ⇒ String
readonly
Template image URL with placeholders for width and height.
Instance Method Summary collapse
-
#url(width, height) ⇒ String
Get a URL pointing to an image with a specific size.
Instance Attribute Details
#large_url ⇒ String (readonly)
Returns URL for the large-sized version of this image.
25 26 27 |
# File 'lib/kappa/images.rb', line 25 def large_url @large_url end |
#medium_url ⇒ String (readonly)
Returns URL for the medium-sized version of this image.
30 31 32 |
# File 'lib/kappa/images.rb', line 30 def medium_url @medium_url end |
#small_url ⇒ String (readonly)
Returns URL for the small-sized version of this image.
35 36 37 |
# File 'lib/kappa/images.rb', line 35 def small_url @small_url end |
#template_url ⇒ String (readonly)
Note:
You shouldn't need to use this property directly. See #url for getting a formatted URL instead.
Returns Template image URL with placeholders for width and height.
42 43 44 |
# File 'lib/kappa/images.rb', line 42 def template_url @template_url end |
Instance Method Details
#url(width, height) ⇒ String
Get a URL pointing to an image with a specific size.
18 19 20 |
# File 'lib/kappa/images.rb', line 18 def url(width, height) @template_url.gsub('{width}', width.to_s).gsub('{height}', height.to_s) end |