class Sip2::Messages::PatronInformation

Sip2 Patron information message

developers.exlibrisgroup.com/wp-content/uploads/2020/01/3M-Standard-Interchange-Protocol-Version-2.00.pdf

Request message 63

* language               - 3 char, fixed-length required field
* transaction date       - 18 char, fixed-length required field: YYYYMMDDZZZZHHMMSS
* summary                - 10 char, fixed-length required field
* institution id    - AO - variable-length required field
* patron identifier - AA - variable-length required field
* terminal password - AC - variable-length optional field
* patron password   - AD - variable-length optional field
* start item        - BP - variable-length optional field
* end item          - BQ - variable-length optional field

Private Instance Methods

build_message(uid:, password:, terminal_password: nil) click to toggle source
# File lib/sip2/messages/patron_information.rb, line 24
def build_message(uid:, password:, terminal_password: nil)
  code = '63' # Patron information
  language = '000' # Unknown
  timestamp = Time.now.strftime('%Y%m%d    %H%M%S')
  summary = ' ' * 10
  [
    code, language, timestamp, summary,
    'AO|AA', uid, '|AC', terminal_password, '|AD', password
  ].join
end
handle_response(response) click to toggle source
# File lib/sip2/messages/patron_information.rb, line 35
def handle_response(response)
  return unless /\A#{Sip2::Responses::PatronInformation::RESPONSE_ID}/o.match?(response)

  Sip2::Responses::PatronInformation.new response
end