Class: Giphy::Client
- Inherits:
-
Object
- Object
- Giphy::Client
- Defined in:
- lib/giphy/client.rb
Instance Method Summary collapse
- #artists(options = {}) ⇒ Object
- #favorite(id) ⇒ Object
- #favorites(username = '', options = {}) ⇒ Object
- #flag(id) ⇒ Object
- #flagged ⇒ Object
- #gif(id) ⇒ Object
- #gifs(ids) ⇒ Object
- #random(tag = '') ⇒ Object
- #screensaver(tag) ⇒ Object
- #search(keyword, options = {}) ⇒ Object
- #translate(word) ⇒ Object
- #trending(options = {}) ⇒ Object
Instance Method Details
#artists(options = {}) ⇒ Object
41 42 43 |
# File 'lib/giphy/client.rb', line 41 def artists(={}) get('/artists', ) end |
#favorite(id) ⇒ Object
24 25 26 |
# File 'lib/giphy/client.rb', line 24 def favorite(id) post("/#{id}/favorites") end |
#favorites(username = '', options = {}) ⇒ Object
28 29 30 31 |
# File 'lib/giphy/client.rb', line 28 def favorites(username='', ={}) = {username: username}.merge() get('/favorites', ) end |
#flag(id) ⇒ Object
16 17 18 |
# File 'lib/giphy/client.rb', line 16 def flag(id) post("/#{id}/flagged") end |
#flagged ⇒ Object
20 21 22 |
# File 'lib/giphy/client.rb', line 20 def flagged get('/flagged') end |
#gif(id) ⇒ Object
45 46 47 |
# File 'lib/giphy/client.rb', line 45 def gif(id) get("/#{id}") end |
#gifs(ids) ⇒ Object
49 50 51 |
# File 'lib/giphy/client.rb', line 49 def gifs(ids) get('', ids: ids.join(',')) end |
#random(tag = '') ⇒ Object
37 38 39 |
# File 'lib/giphy/client.rb', line 37 def random(tag='') get('/random', { tag: tag }) end |
#screensaver(tag) ⇒ Object
33 34 35 |
# File 'lib/giphy/client.rb', line 33 def screensaver(tag) get('/screensaver', tag: tag) end |
#search(keyword, options = {}) ⇒ Object
11 12 13 14 |
# File 'lib/giphy/client.rb', line 11 def search(keyword, ={}) = {q: keyword}.merge() get('/search', ) end |
#translate(word) ⇒ Object
7 8 9 |
# File 'lib/giphy/client.rb', line 7 def translate(word) get('/translate', s: word) end |
#trending(options = {}) ⇒ Object
3 4 5 |
# File 'lib/giphy/client.rb', line 3 def trending(={}) get('/trending', ) end |