Class: Icndb::Client
Class Method Summary collapse
- .get_all_jokes ⇒ Object
- .get_categories ⇒ Object
- .get_jokes(count = 1) ⇒ Object
- .get_jokes_categories_based(categories = [], count = 1) ⇒ Object
- .get_jokes_exclude_categories(categories = [], count = 1) ⇒ Object
- .get_random_joke ⇒ Object
- .get_random_jokes(count = 1) ⇒ Object
Class Method Details
.get_all_jokes ⇒ Object
18 19 20 |
# File 'lib/icndb.rb', line 18 def self.get_all_jokes request("/jokes") end |
.get_categories ⇒ Object
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_joke ⇒ Object
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 |