Class: Giphy::Gif
- Inherits:
-
Object
- Object
- Giphy::Gif
- Defined in:
- lib/giphy/gif.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bitly_fullscreen_url ⇒ Object
- #bitly_gif_url ⇒ Object
- #bitly_tiled_url ⇒ Object
- #embed_url ⇒ Object
- #fixed_height_downsampled_image ⇒ Object
- #fixed_height_image ⇒ Object
- #fixed_height_still_image ⇒ Object
- #fixed_width_downsampled_image ⇒ Object
- #fixed_width_image ⇒ Object
- #fixed_width_still_image ⇒ Object
- #id ⇒ Object
- #image_original_url ⇒ Object
-
#initialize(hash) ⇒ Gif
constructor
A new instance of Gif.
- #original_image ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(hash) ⇒ Gif
Returns a new instance of Gif.
7 8 9 |
# File 'lib/giphy/gif.rb', line 7 def initialize(hash) @hash = hash end |
Class Method Details
.build_batch_from(array) ⇒ Object
3 4 5 |
# File 'lib/giphy/gif.rb', line 3 def self.build_batch_from(array) array.map { |gif| new(gif) } end |
Instance Method Details
#bitly_fullscreen_url ⇒ Object
23 24 25 |
# File 'lib/giphy/gif.rb', line 23 def bitly_fullscreen_url URI(hash.fetch('bitly_fullscreen_url', '')) end |
#bitly_gif_url ⇒ Object
19 20 21 |
# File 'lib/giphy/gif.rb', line 19 def bitly_gif_url URI(hash.fetch('bitly_gif_url', '')) end |
#bitly_tiled_url ⇒ Object
27 28 29 |
# File 'lib/giphy/gif.rb', line 27 def bitly_tiled_url URI(hash.fetch('bitly_tiled_url', '')) end |
#embed_url ⇒ Object
31 32 33 |
# File 'lib/giphy/gif.rb', line 31 def URI(hash.fetch('embed_url', '')) end |
#fixed_height_downsampled_image ⇒ Object
43 44 45 |
# File 'lib/giphy/gif.rb', line 43 def fixed_height_downsampled_image @fixed_height_downsampled_image ||= image(images['fixed_height_downsampled']) end |
#fixed_height_image ⇒ Object
35 36 37 |
# File 'lib/giphy/gif.rb', line 35 def fixed_height_image @fixed_height_image ||= image(images['fixed_height']) end |
#fixed_height_still_image ⇒ Object
39 40 41 |
# File 'lib/giphy/gif.rb', line 39 def fixed_height_still_image @fixed_height_still_image ||= image(images['fixed_height_still']) end |
#fixed_width_downsampled_image ⇒ Object
55 56 57 |
# File 'lib/giphy/gif.rb', line 55 def fixed_width_downsampled_image @fixed_width_downsampled_image ||= image(images['fixed_width_downsampled']) end |
#fixed_width_image ⇒ Object
47 48 49 |
# File 'lib/giphy/gif.rb', line 47 def fixed_width_image @fixed_width_image ||= image(images['fixed_width']) end |
#fixed_width_still_image ⇒ Object
51 52 53 |
# File 'lib/giphy/gif.rb', line 51 def fixed_width_still_image @fixed_width_still_image ||= image(images['fixed_width_still']) end |
#id ⇒ Object
11 12 13 |
# File 'lib/giphy/gif.rb', line 11 def id hash.fetch('id') end |
#image_original_url ⇒ Object
63 64 65 |
# File 'lib/giphy/gif.rb', line 63 def image_original_url URI(hash.fetch('image_original_url', '')) end |
#original_image ⇒ Object
59 60 61 |
# File 'lib/giphy/gif.rb', line 59 def original_image @original_image ||= image(images['original']) end |
#url ⇒ Object
15 16 17 |
# File 'lib/giphy/gif.rb', line 15 def url URI(hash.fetch('url', '')) end |