class Devrant::Rants

Attributes

parent[RW]

Public Instance Methods

all() click to toggle source
# File lib/devrant/rants.rb, line 8
def all
  structuralize(self.class.get('/devrant/rants')).rants
end
collabs() click to toggle source
# File lib/devrant/rants.rb, line 24
def collabs
  structuralize(self.class.get('/devrant/collabs')).rants
end
comment(rant, content, token_id, token_key, user_id) click to toggle source
# File lib/devrant/rants.rb, line 44
def comment(rant, content, token_id, token_key, user_id)
  structuralize(self.class.post("/devrant/rants/#{rant}/comments", extend_request(:body, {token_id: token_id, token_key: token_key, user_id: user_id, comment: content})))
end
get_rant(id) click to toggle source
# File lib/devrant/rants.rb, line 28
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={}) click to toggle source
# File lib/devrant/rants.rb, line 36
def get_rants(params={})
  structuralize(self.class.get('/devrant/rants', extend_request(:query, params))).rants 
end
random() click to toggle source
# File lib/devrant/rants.rb, line 16
def random
  structuralize(self.class.get('/devrant/rants/surprise')).rant
end
stories() click to toggle source
# File lib/devrant/rants.rb, line 20
def stories
  structuralize(self.class.get('/devrant/story-rants')).rants
end
weekly() click to toggle source
# File lib/devrant/rants.rb, line 12
def weekly
  structuralize(self.class.get('/devrant/weekly-rants')).rants
end