Sha256: d735577274c4a6d95a9e5423ee62afe312481094cfa3fe122f2ebda14dc4f53e
Contents?: true
Size: 474 Bytes
Versions: 21
Compression:
Stored size: 474 Bytes
Contents
class AmazonSidebar < Sidebar description \ "Adds sidebar links to any amazon books linked in the body of the page" setting :title, 'Cited books' setting :associate_id, 'justasummary-20' setting :maxlinks, 4 attr_accessor :asins def parse_request(contents, request_params) asin_list = contents.to_a.inject([]) do |acc, item| acc + item.whiteboard[:asins].to_a end self.asins = asin_list.uniq.compact[0,maxlinks.to_i] end end
Version data entries
21 entries across 21 versions & 1 rubygems