Class: Devrant::Rants
- Inherits:
-
Object
- Object
- Devrant::Rants
- Includes:
- Devrant, HTTParty
- Defined in:
- lib/devrant/rants.rb
Constant Summary
Constants included from Devrant
Instance Method Summary collapse
Methods included from Devrant
Instance Method Details
#all ⇒ Object
6 7 8 |
# File 'lib/devrant/rants.rb', line 6 def all structuralize(self.class.get('/devrant/rants')).rants end |
#get_rant(id) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/devrant/rants.rb', line 10 def get_rant(id) rant = structuralize(self.class.get("/devrant/rants/#{id}")).rant return rant unless rant.nil? raise ArgumentError.new("No rant found for id #{id}") end |
#get_rants(params = {}) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/devrant/rants.rb', line 18 def get_rants(params={}) = { query: self.class.[:query].merge(params) } rants = structuralize(self.class.get("/devrant/rants", )).rants end |