class Giphy::Client

Public Instance Methods

artists(options={}) click to toggle source
# File lib/giphy/client.rb, line 41
def artists(options={})
  get('/artists', options)
end
favorite(id) click to toggle source
# File lib/giphy/client.rb, line 24
def favorite(id)
  post("/#{id}/favorites")
end
favorites(username='', options={}) click to toggle source
# File lib/giphy/client.rb, line 28
def favorites(username='', options={})
  options_hash = {username: username}.merge(options)
  get('/favorites', options_hash)
end
flag(id) click to toggle source
# File lib/giphy/client.rb, line 16
def flag(id)
  post("/#{id}/flagged")
end
flagged() click to toggle source
# File lib/giphy/client.rb, line 20
def flagged
  get('/flagged')
end
gif(id) click to toggle source
# File lib/giphy/client.rb, line 45
def gif(id)
  get("/#{id}")
end
gifs(ids) click to toggle source
# File lib/giphy/client.rb, line 49
def gifs(ids)
  get('', ids: ids.join(','))
end
random(tag='') click to toggle source
# File lib/giphy/client.rb, line 37
def random(tag='')
  get('/random', { tag: tag })
end
screensaver(tag) click to toggle source
# File lib/giphy/client.rb, line 33
def screensaver(tag)
  get('/screensaver', tag: tag)
end
translate(word) click to toggle source
# File lib/giphy/client.rb, line 7
def translate(word)
  get('/translate', s: word)
end

Private Instance Methods

get(path, options={}) click to toggle source
# File lib/giphy/client.rb, line 55
def get(path, options={})
  api_response = request.get(path, options)
  response(api_response)
end
post(path, options={}) click to toggle source
# File lib/giphy/client.rb, line 60
def post(path, options={})
  api_response = request.post(path, options)
  response(api_response)
end
request() click to toggle source
# File lib/giphy/client.rb, line 65
def request
  Giphy::Request
end
response(api_response) click to toggle source
# File lib/giphy/client.rb, line 69
def response(api_response)
  Giphy::Response.build(api_response)
end