Class: Giphy::RandomGif
- Inherits:
-
Object
- Object
- Giphy::RandomGif
- Defined in:
- lib/giphy/random_gif.rb
Instance Method Summary collapse
- #caption ⇒ Object
- #id ⇒ Object
- #image_frames ⇒ Object
- #image_height ⇒ Object
- #image_mp4_url ⇒ Object
- #image_original_url ⇒ Object
- #image_url ⇒ Object
- #image_width ⇒ Object
-
#initialize(hash) ⇒ RandomGif
constructor
A new instance of RandomGif.
- #rating ⇒ Object
- #tags ⇒ Object
- #url ⇒ Object
- #username ⇒ Object
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
#caption ⇒ Object
47 48 49 |
# File 'lib/giphy/random_gif.rb', line 47 def hash.fetch('caption') end |
#id ⇒ Object
7 8 9 |
# File 'lib/giphy/random_gif.rb', line 7 def id hash.fetch('id') end |
#image_frames ⇒ Object
27 28 29 |
# File 'lib/giphy/random_gif.rb', line 27 def image_frames hash.fetch('image_frames') end |
#image_height ⇒ Object
35 36 37 |
# File 'lib/giphy/random_gif.rb', line 35 def image_height hash.fetch('image_height') end |
#image_mp4_url ⇒ Object
23 24 25 |
# File 'lib/giphy/random_gif.rb', line 23 def image_mp4_url URI(hash.fetch('image_mp4_url')) end |
#image_original_url ⇒ Object
15 16 17 |
# File 'lib/giphy/random_gif.rb', line 15 def image_original_url URI(hash.fetch('image_original_url')) end |
#image_url ⇒ Object
19 20 21 |
# File 'lib/giphy/random_gif.rb', line 19 def image_url URI(hash.fetch('image_url')) end |
#image_width ⇒ Object
31 32 33 |
# File 'lib/giphy/random_gif.rb', line 31 def image_width hash.fetch('image_width') end |
#rating ⇒ Object
39 40 41 |
# File 'lib/giphy/random_gif.rb', line 39 def hash.fetch('rating') end |
#tags ⇒ Object
51 52 53 |
# File 'lib/giphy/random_gif.rb', line 51 def hash.fetch('tags') end |
#url ⇒ Object
11 12 13 |
# File 'lib/giphy/random_gif.rb', line 11 def url URI(hash.fetch('url')) end |
#username ⇒ Object
43 44 45 |
# File 'lib/giphy/random_gif.rb', line 43 def username hash.fetch('username') end |