Module: Goodreads::Reviews
- Included in:
- Client
- Defined in:
- lib/goodreads/client/reviews.rb
Instance Method Summary collapse
-
#recent_reviews(params = {}) ⇒ Object
Recent reviews from all members.
-
#review(id) ⇒ Object
Get review details.
Instance Method Details
#recent_reviews(params = {}) ⇒ Object
Recent reviews from all members.
params - Select only non-cropped reviews
7 8 9 10 11 12 13 14 15 |
# File 'lib/goodreads/client/reviews.rb', line 7 def recent_reviews(params={}) skip_cropped = params.delete(:skip_cropped) || false data = request('/review/recent_reviews', params) if data['reviews'] && data['reviews'].key?('review') reviews = data['reviews']['review'].map { |r| Hashie::Mash.new(r) } reviews = reviews.select { |r| !r.body.include?(r.url) } if skip_cropped reviews end end |
#review(id) ⇒ Object
Get review details
19 20 21 22 |
# File 'lib/goodreads/client/reviews.rb', line 19 def review(id) data = request('/review/show', :id => id) Hashie::Mash.new(data['review']) end |