Class: Alexandria::BookProviders::BLProvider

Inherits:
Z3950Provider show all
Includes:
GetText
Defined in:
lib/alexandria/book_providers/bl_provider.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.



27
28
29
30
31
32
33
34
35
# File 'lib/alexandria/book_providers/bl_provider.rb', line 27

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



37
38
39
40
41
42
# File 'lib/alexandria/book_providers/bl_provider.rb', line 37

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