Class: RemoteBook::BarnesAndNoble

Inherits:
Base
  • Object
show all
Defined in:
lib/remote_book/barnes_and_noble.rb

Constant Summary collapse

ISBN_SEARCH_BASE_URI =
"http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?ISBSRC=Y&ISBN="
"http://getdeeplink.linksynergy.com/createcustomlink.shtml"
"36889"

Instance Attribute Summary collapse

Attributes inherited from Base

#isbn, #link

Class Method Summary collapse

Methods inherited from Base

associate_keys, associate_keys=, #author, find_by_isbn, setup

Instance Attribute Details

Returns the value of attribute affiliate_link.



10
11
12
# File 'lib/remote_book/barnes_and_noble.rb', line 10

def affiliate_link
  @affiliate_link
end

Returns the value of attribute raw_link.



10
11
12
# File 'lib/remote_book/barnes_and_noble.rb', line 10

def raw_link
  @raw_link
end

Class Method Details

.find(options) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/remote_book/barnes_and_noble.rb', line 12

def self.find(options)
  b = new
  if options[:isbn]
    bn_page = barnes_and_noble_page_link_for(options[:isbn])
    return nil unless bn_page
    b.raw_link = bn_page
    b.affiliate_link = link_share_deep_link_for(bn_page)

    b.link = b.affiliate_link.nil? ? b.raw_link : b.affiliate_link
  end
  b
end