Class: Giphy::Client

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

Instance Method Summary collapse

Instance Method Details

#artists(options = {}) ⇒ Object



40
41
42
# File 'lib/giphy/client.rb', line 40

def artists(options={})
  get('/artists', options)
end

#favorite(id) ⇒ Object



24
25
26
# File 'lib/giphy/client.rb', line 24

def favorite(id)
  post("/#{id}/favorites")
end

#favoritesObject



28
29
30
# File 'lib/giphy/client.rb', line 28

def favorites
  get('/favorites')
end

#flag(id) ⇒ Object



16
17
18
# File 'lib/giphy/client.rb', line 16

def flag(id)
 post("/#{id}/flagged")
end

#flaggedObject



20
21
22
# File 'lib/giphy/client.rb', line 20

def flagged
  get('/flagged')
end

#gif(id) ⇒ Object



44
45
46
# File 'lib/giphy/client.rb', line 44

def gif(id)
  get("/#{id}")
end

#gifs(ids) ⇒ Object



48
49
50
# File 'lib/giphy/client.rb', line 48

def gifs(ids)
  get('', ids: ids.join(','))
end

#randomObject



36
37
38
# File 'lib/giphy/client.rb', line 36

def random
  get('/random')
end

#recent(options = {}) ⇒ Object



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

def recent(options={})
  get('/recent', options)
end

#screensaver(tag) ⇒ Object



32
33
34
# File 'lib/giphy/client.rb', line 32

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, options={})
  options_hash = {q: keyword}.merge(options)
  get('/search', options_hash)
end

#translate(word) ⇒ Object



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

def translate(word)
  get('/translate', s: word)
end