Method: GoogleBookSearch#initialize
- Defined in:
- app/service_adaptors/google_book_search.rb
#initialize(config) ⇒ GoogleBookSearch
Returns a new instance of GoogleBookSearch.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'app/service_adaptors/google_book_search.rb', line 73 def initialize(config) @url = 'https://www.googleapis.com/books/v1/volumes?q=' @display_name = 'Google Books' # number of full views to show @num_full_views = 1 # default on, to enhance our metadata with stuff from google @referent_enhance = true # default OFF, add description/abstract from GBS @abstract = false # Other responses on by default but can be turned off @cover_image = true @fulltext = true @search_inside = true @web_links = true # to partial view :excerpts or :fulltext # google api key strongly recommended, otherwise you'll # probably get rate limited. @api_key = nil @credits = { "Google Books" => "http://books.google.com/" } # While you can theoretically look up by LCCN on Google Books, # we have found FREQUENT false positives. There's no longer any # way to even report these to Google. By default, don't lookup # by LCCN. @lookup_by_lccn = false super(config) end |