Class: BorrowDirect::Defaults

Inherits:
Object
  • Object
show all
Defined in:
lib/borrow_direct/defaults.rb

Overview

Some defaults for BD requests, including some you might def want to set at app boot, perhaps in a Rails initializer.

To use the production BD system instead of test system:

BorrowDirect::Defaults.api_base = BorrowDirect::Defaults::PRODUCTION_API_BASE

To set your library’s BD symbol as a default:

BorrowDirect::Defaults.library_symbol = "YOURSYMBOL"

To set a default generic patron barcode to use for FindItem requests

BorrowDirect::Defaults.find_item_patron_barcode = "99999999999"

Constant Summary collapse

TEST_API_BASE =
"https://rc.relais-host.com/"
PRODUCTION_API_BASE =
"https://borrow-direct.relais-host.com/"
TEST_HTML_BASE =
"https://bdtest.relaisd2d.com/service-proxy?command=query"
PRODUCTION_HTML_BASE =
"https://borrow-direct.relaisd2d.com/service-proxy?command=query"

Class Attribute Summary collapse

Class Attribute Details

.api_baseObject

Returns the value of attribute api_base.



23
24
25
# File 'lib/borrow_direct/defaults.rb', line 23

def api_base
  @api_base
end

.api_keyObject

Returns the value of attribute api_key.



25
26
27
# File 'lib/borrow_direct/defaults.rb', line 25

def api_key
  @api_key
end

.find_item_patron_barcodeObject

Returns the value of attribute find_item_patron_barcode.



23
24
25
# File 'lib/borrow_direct/defaults.rb', line 23

def find_item_patron_barcode
  @find_item_patron_barcode
end

.html_base_urlObject

Returns the value of attribute html_base_url.



24
25
26
# File 'lib/borrow_direct/defaults.rb', line 24

def html_base_url
  @html_base_url
end

.library_symbolObject

Returns the value of attribute library_symbol.



23
24
25
# File 'lib/borrow_direct/defaults.rb', line 23

def library_symbol
  @library_symbol
end

.partnership_idObject

Returns the value of attribute partnership_id.



23
24
25
# File 'lib/borrow_direct/defaults.rb', line 23

def partnership_id
  @partnership_id
end

.timeoutObject

used for HTTPClient send, connection, AND receive timeouts, so theoretically could take 3x this, but unlikely, usually it’s just receive that might timeout. In seconds. Default 30s.



30
31
32
# File 'lib/borrow_direct/defaults.rb', line 30

def timeout
  @timeout
end