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

Version Path
typo-5.5 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.4.4 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.4.3 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.4.2 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.4.1 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.4 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-4.1.1 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.0.1 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.0.2 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-4.1 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.0.3.98.1 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.0.3.98 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.0 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.1.2 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.1.1 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.1.3 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.1 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.1.98 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.2.98 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb
typo-5.2 vendor/plugins/amazon_sidebar/lib/amazon_sidebar.rb