Class: Alexandria::BookProviders::BLProvider

Inherits:
Z3950Provider show all
Includes:
GetText
Defined in:
lib/alexandria/book_providers/z3950.rb

Instance Attribute Summary

Attributes inherited from AbstractProvider

#fullname, #name, #prefs

Instance Method Summary collapse

Methods inherited from Z3950Provider

#books_from_resultset, #search

Methods included from Logging

included, #log

Methods inherited from AbstractProvider

#<=>, abstract?, #abstract?, #action_name, #enabled, #reinitialize, #remove, #toggle_enabled, #transport, unabstract, #variable_name

Constructor Details

#initializeBLProvider

Returns a new instance of BLProvider.



248
249
250
251
252
253
254
255
256
# File 'lib/alexandria/book_providers/z3950.rb', line 248

def initialize
  super("BL", _("British Library"))
  prefs.variable_named("hostname").default_value = "z3950cat.bl.uk"
  prefs.variable_named("port").default_value = 9909
  prefs.variable_named("database").default_value = "BLAC"
  prefs.variable_named("record_syntax").default_value = "SUTRS"
  prefs.variable_named("charset").default_value = "ISO-8859-1"
  prefs.read
end

Instance Method Details

#url(book) ⇒ Object



258
259
260
261
262
263
# File 'lib/alexandria/book_providers/z3950.rb', line 258

def url(book)
  "http://copac.ac.uk/openurl?isbn=" + Library.canonicalise_isbn(book.isbn)
rescue StandardError => ex
  log.warn { "Cannot create url for book #{book}; #{ex.message}" }
  nil
end