Class: Icndb::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/icndb.rb

Class Method Summary collapse

Class Method Details

.get_all_jokesObject



18
19
20
# File 'lib/icndb.rb', line 18

def self.get_all_jokes
  request("/jokes")
end

.get_categoriesObject



14
15
16
# File 'lib/icndb.rb', line 14

def self.get_categories
  request("/categories")
end

.get_jokes(count = 1) ⇒ Object



22
23
24
# File 'lib/icndb.rb', line 22

def self.get_jokes(count=1)
  request("/jokes/#{count}")
end

.get_jokes_categories_based(categories = [], count = 1) ⇒ Object



34
35
36
# File 'lib/icndb.rb', line 34

def self.get_jokes_categories_based(categories=[], count=1)
  request("/jokes/random/#{count}?limitTo=#{categories}")
end

.get_jokes_exclude_categories(categories = [], count = 1) ⇒ Object



38
39
40
# File 'lib/icndb.rb', line 38

def self.get_jokes_exclude_categories(categories=[], count=1)
  request("/jokes/random/#{count}?exclude=#{categories}")
end

.get_random_jokeObject



26
27
28
# File 'lib/icndb.rb', line 26

def self.get_random_joke
  request("/jokes/random")
end

.get_random_jokes(count = 1) ⇒ Object



30
31
32
# File 'lib/icndb.rb', line 30

def self.get_random_jokes(count=1)
  request("/jokes/random/#{count}")
end