class Podio::Rating
Public Class Methods
create(ref_type, ref_id, rating_type, value)
click to toggle source
@see developers.podio.com/doc/ratings/add-rating-22377
# File lib/podio/models/rating.rb, line 12 def create(ref_type, ref_id, rating_type, value) response = Podio.connection.post do |req| req.url "/rating/#{ref_type}/#{ref_id}/#{rating_type}" req.body = { :value => value } end response.body['rating_id'] end
delete(ref_type, ref_id, rating_type)
click to toggle source
@see developers.podio.com/doc/ratings/remove-rating-22342
# File lib/podio/models/rating.rb, line 42 def delete(ref_type, ref_id, rating_type) Podio.connection.delete("/rating/#{ref_type}/#{ref_id}/#{rating_type}").body end
find(ref_type, ref_id, rating_type, user_id)
click to toggle source
@see developers.podio.com/doc/ratings/get-rating-22407
# File lib/podio/models/rating.rb, line 27 def find(ref_type, ref_id, rating_type, user_id) Podio.connection.get("/rating/#{ref_type}/#{ref_id}/#{rating_type}/#{user_id}").body['value'] end
find_all(ref_type, ref_id)
click to toggle source
@see developers.podio.com/doc/ratings/get-all-ratings-22376
# File lib/podio/models/rating.rb, line 22 def find_all(ref_type, ref_id) collection Podio.connection.get("/rating/#{ref_type}/#{ref_id}").body end
find_all_by_type(ref_type, ref_id, rating_type)
click to toggle source
@see developers.podio.com/doc/ratings/get-ratings-22375
# File lib/podio/models/rating.rb, line 37 def find_all_by_type(ref_type, ref_id, rating_type) collection Podio.connection.get("/rating/#{ref_type}/#{ref_id}/#{rating_type}").body end
find_own(ref_type, ref_id, rating_type)
click to toggle source
@see developers.podio.com/doc/ratings/get-rating-own-84128
# File lib/podio/models/rating.rb, line 32 def find_own(ref_type, ref_id, rating_type) Podio.connection.get("/rating/#{ref_type}/#{ref_id}/#{rating_type}/self").body['value'] end
like_count(ref_type, ref_id)
click to toggle source
@see developers.podio.com/doc/ratings/get-like-count-32161225
# File lib/podio/models/rating.rb, line 54 def like_count(ref_type, ref_id) Podio.connection.get("/rating/#{ref_type}/#{ref_id}/like_count").body["like_count"] end
liked_by(ref_type, ref_id, options={})
click to toggle source
@see developers.podio.com/doc/comments/get-who-liked-a-comment-29007011
# File lib/podio/models/rating.rb, line 47 def liked_by(ref_type, ref_id, options={}) Podio.connection.get { |req| req.url("/rating/#{ref_type}/#{ref_id}/liked_by/", options) }.body.map{|values| Podio::Contact.new(values)} end