Module: Giphy::Search
- Included in:
- Giphy
- Defined in:
- lib/giphy/search.rb
Instance Method Summary collapse
- #artists ⇒ Object
- #favorite(id) ⇒ Object
- #favorites(username, options) ⇒ Object
- #flag(id) ⇒ Object
- #flagged ⇒ Object
- #gif_by_artist(username, options = {}) ⇒ Object
- #gif_by_id(*ids) ⇒ Object
- #random(tag = '') ⇒ Object
- #screensaver(tag) ⇒ Object
- #search(keyword, options = {}) ⇒ Object
- #translate(word) ⇒ Object
- #trending(options = {}) ⇒ Object
Instance Method Details
#artists ⇒ Object
48 49 50 51 |
# File 'lib/giphy/search.rb', line 48 def artists result = client.artists artist.build_batch_from(result) end |
#favorite(id) ⇒ Object
28 29 30 31 |
# File 'lib/giphy/search.rb', line 28 def favorite(id) result = client.favorite(id) favorite_gif.new(result) end |
#favorites(username, options) ⇒ Object
33 34 35 36 |
# File 'lib/giphy/search.rb', line 33 def favorites(username, ) result = client.favorites(username, ) favorite_gif.build_batch_from(result) end |
#flag(id) ⇒ Object
18 19 20 21 |
# File 'lib/giphy/search.rb', line 18 def flag(id) result = client.flag(id) flagged_gif.new(result) end |
#flagged ⇒ Object
23 24 25 26 |
# File 'lib/giphy/search.rb', line 23 def flagged result = client.flagged flagged_gif.build_batch_from(result) end |
#gif_by_artist(username, options = {}) ⇒ Object
53 54 55 56 57 |
# File 'lib/giphy/search.rb', line 53 def gif_by_artist(username, ={}) = {username: username}.merge() result = client.artists() gif.build_batch_from(result) end |
#gif_by_id(*ids) ⇒ Object
59 60 61 |
# File 'lib/giphy/search.rb', line 59 def gif_by_id(*ids) GifByID.new.get(ids) end |
#random(tag = '') ⇒ Object
43 44 45 46 |
# File 'lib/giphy/search.rb', line 43 def random(tag='') result = client.random(tag) random_gif.new(result) end |
#screensaver(tag) ⇒ Object
38 39 40 41 |
# File 'lib/giphy/search.rb', line 38 def screensaver(tag) result = client.screensaver(tag) gif.new(result) end |
#search(keyword, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/giphy/search.rb', line 13 def search(keyword, ={}) result = client.search(keyword, ) gif.build_batch_from(result) end |
#translate(word) ⇒ Object
8 9 10 11 |
# File 'lib/giphy/search.rb', line 8 def translate(word) result = client.translate(word) gif.build_batch_from(result) end |
#trending(options = {}) ⇒ Object
3 4 5 6 |
# File 'lib/giphy/search.rb', line 3 def trending(={}) result = client.trending() gif.build_batch_from(result) end |