Module: Giphy::Search

Included in:
Giphy
Defined in:
lib/giphy/search.rb

Instance Method Summary collapse

Instance Method Details

#artistsObject



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

def artists
  result = client.artists
  artist.build_batch_from(result)
end

#favorite(id) ⇒ Object



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

def favorite(id)
  result = client.favorite(id)
  favorite_gif.new(result)
end

#favorites(username, options) ⇒ Object



33
34
35
36
# File 'lib/giphy/search.rb', line 33

def favorites(username, options)
  result = client.favorites(username, options)
  favorite_gif.build_batch_from(result)
end

#flag(id) ⇒ Object



18
19
20
21
# File 'lib/giphy/search.rb', line 18

def flag(id)
  result = client.flag(id)
  flagged_gif.new(result)
end

#flaggedObject



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

def flagged
  result = client.flagged
  flagged_gif.build_batch_from(result)
end

#gif_by_artist(username, options = {}) ⇒ Object



53
54
55
56
57
# File 'lib/giphy/search.rb', line 53

def gif_by_artist(username, options={})
  options_hash = {username: username}.merge(options)
  result = client.artists(options_hash)
  gif.build_batch_from(result)
end

#gif_by_id(*ids) ⇒ Object



59
60
61
# File 'lib/giphy/search.rb', line 59

def gif_by_id(*ids)
  GifByID.new.get(ids)
end

#random(tag = '') ⇒ Object



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

def random(tag='')
  result = client.random(tag)
  random_gif.new(result)
end

#screensaver(tag) ⇒ Object



38
39
40
41
# File 'lib/giphy/search.rb', line 38

def screensaver(tag)
  result = client.screensaver(tag)
  gif.new(result)
end

#search(keyword, options = {}) ⇒ Object



13
14
15
16
# File 'lib/giphy/search.rb', line 13

def search(keyword, options={})
  result = client.search(keyword, options)
  gif.build_batch_from(result)
end

#translate(word) ⇒ Object



8
9
10
11
# File 'lib/giphy/search.rb', line 8

def translate(word)
  result = client.translate(word)
  gif.build_batch_from(result)
end


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

def trending(options={})
  result = client.trending(options)
  gif.build_batch_from(result)
end