Class: Giphy::RandomGif

Inherits:
Object
  • Object
show all
Defined in:
lib/giphy/random_gif.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ RandomGif

Returns a new instance of RandomGif.



3
4
5
# File 'lib/giphy/random_gif.rb', line 3

def initialize(hash)
  @hash = hash
end

Instance Method Details

#captionObject



47
48
49
# File 'lib/giphy/random_gif.rb', line 47

def caption
  hash.fetch('caption')
end

#idObject



7
8
9
# File 'lib/giphy/random_gif.rb', line 7

def id
  hash.fetch('id')
end

#image_framesObject



27
28
29
# File 'lib/giphy/random_gif.rb', line 27

def image_frames
  hash.fetch('image_frames')
end

#image_heightObject



35
36
37
# File 'lib/giphy/random_gif.rb', line 35

def image_height
  hash.fetch('image_height')
end

#image_mp4_urlObject



23
24
25
# File 'lib/giphy/random_gif.rb', line 23

def image_mp4_url
  URI(hash.fetch('image_mp4_url'))
end

#image_original_urlObject



15
16
17
# File 'lib/giphy/random_gif.rb', line 15

def image_original_url
  URI(hash.fetch('image_original_url'))
end

#image_urlObject



19
20
21
# File 'lib/giphy/random_gif.rb', line 19

def image_url
  URI(hash.fetch('image_url'))
end

#image_widthObject



31
32
33
# File 'lib/giphy/random_gif.rb', line 31

def image_width
  hash.fetch('image_width')
end

#ratingObject



39
40
41
# File 'lib/giphy/random_gif.rb', line 39

def rating
  hash.fetch('rating')
end

#tagsObject



51
52
53
# File 'lib/giphy/random_gif.rb', line 51

def tags
  hash.fetch('tags')
end

#urlObject



11
12
13
# File 'lib/giphy/random_gif.rb', line 11

def url
  URI(hash.fetch('url'))
end

#usernameObject



43
44
45
# File 'lib/giphy/random_gif.rb', line 43

def username
  hash.fetch('username')
end