class Giphy::Gif
Attributes
hash[R]
Public Class Methods
build_batch_from(array)
click to toggle source
# File lib/giphy/gif.rb, line 3 def self.build_batch_from(array) array.map { |gif| new(gif) } end
new(hash)
click to toggle source
# File lib/giphy/gif.rb, line 7 def initialize(hash) @hash = hash end
Public Instance Methods
bitly_fullscreen_url()
click to toggle source
# File lib/giphy/gif.rb, line 23 def bitly_fullscreen_url URI(hash.fetch('bitly_fullscreen_url', '')) end
bitly_gif_url()
click to toggle source
# File lib/giphy/gif.rb, line 19 def bitly_gif_url URI(hash.fetch('bitly_gif_url', '')) end
bitly_tiled_url()
click to toggle source
# File lib/giphy/gif.rb, line 27 def bitly_tiled_url URI(hash.fetch('bitly_tiled_url', '')) end
embed_url()
click to toggle source
# File lib/giphy/gif.rb, line 31 def embed_url URI(hash.fetch('embed_url', '')) end
fixed_height_downsampled_image()
click to toggle source
# 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()
click to toggle source
# File lib/giphy/gif.rb, line 35 def fixed_height_image @fixed_height_image ||= image(images['fixed_height']) end
fixed_height_still_image()
click to toggle source
# 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()
click to toggle source
# 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()
click to toggle source
# File lib/giphy/gif.rb, line 47 def fixed_width_image @fixed_width_image ||= image(images['fixed_width']) end
fixed_width_still_image()
click to toggle source
# File lib/giphy/gif.rb, line 51 def fixed_width_still_image @fixed_width_still_image ||= image(images['fixed_width_still']) end
id()
click to toggle source
# File lib/giphy/gif.rb, line 11 def id hash.fetch('id') end
image_original_url()
click to toggle source
# File lib/giphy/gif.rb, line 63 def image_original_url URI(hash.fetch('image_original_url', '')) end
original_image()
click to toggle source
# File lib/giphy/gif.rb, line 59 def original_image @original_image ||= image(images['original']) end
url()
click to toggle source
# File lib/giphy/gif.rb, line 15 def url URI(hash.fetch('url', '')) end
Private Instance Methods
image(image_hash)
click to toggle source
# File lib/giphy/gif.rb, line 75 def image(image_hash) image_hash ? Giphy::Image.new(image_hash) : null_image end
images()
click to toggle source
# File lib/giphy/gif.rb, line 71 def images @images ||= hash.fetch('images', {}) end
null_image()
click to toggle source
# File lib/giphy/gif.rb, line 79 def null_image NullImage.new end