Class: Giphy::Client

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

Instance Method Summary collapse

Instance Method Details

#artists(options = {}) ⇒ Object



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

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

#favorites(username = '', options = {}) ⇒ Object



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

def favorites(username='', options={})
  options_hash = {username: username}.merge(options)
  get('/favorites', options_hash)
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



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, 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


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

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