Class: Loadgif::Client
- Inherits:
-
Object
- Object
- Loadgif::Client
- Defined in:
- lib/loadgif/client.rb
Instance Method Summary collapse
- #favorite(id) ⇒ Object
- #favorites(username = '', options = {}) ⇒ 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
#favorite(id) ⇒ Object
16 17 18 |
# File 'lib/loadgif/client.rb', line 16 def favorite(id) post("/#{id}/favorites") end |
#favorites(username = '', options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/loadgif/client.rb', line 20 def favorites(username='', ={}) = {username: username}.merge() get('/favorites', ) end |
#gif(id) ⇒ Object
33 34 35 |
# File 'lib/loadgif/client.rb', line 33 def gif(id) get("/#{id}") end |
#gifs(ids) ⇒ Object
37 38 39 |
# File 'lib/loadgif/client.rb', line 37 def gifs(ids) get('', ids: ids.join(',')) end |
#random(tag = '') ⇒ Object
29 30 31 |
# File 'lib/loadgif/client.rb', line 29 def random(tag='') get('/random', { tag: tag }) end |
#screensaver(tag) ⇒ Object
25 26 27 |
# File 'lib/loadgif/client.rb', line 25 def screensaver(tag) get('/screensaver', tag: tag) end |
#search(keyword, options = {}) ⇒ Object
11 12 13 14 |
# File 'lib/loadgif/client.rb', line 11 def search(keyword, ={}) = {q: keyword}.merge() get('/search', ) end |
#translate(word) ⇒ Object
7 8 9 |
# File 'lib/loadgif/client.rb', line 7 def translate(word) get('/translate', s: word) end |
#trending(options = {}) ⇒ Object
3 4 5 |
# File 'lib/loadgif/client.rb', line 3 def trending(={}) get('/trending', ) end |