Skip to content

Commit

Permalink
reviews can be an array, so handle accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdempsey committed Apr 28, 2011
1 parent 5c72887 commit 907cc63
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/asin/item.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,8 +39,18 @@ def url
end end


def description def description
@raw.EditorialReviews!.EditorialReview!.Content || desc = ''
(features = @raw.ItemAttributes!.Feature! and features.join('.')) review = @raw.EditorialReviews!.EditorialReview!
if review
if review.respond_to?(:Content)
desc
else
review.map{|item| item.Content}.join('.')
end
else
desc = (features = @raw.ItemAttributes!.Feature! and features.join('.'))
end
desc
end end


def image def image
Expand Down

0 comments on commit 907cc63

Please sign in to comment.