class Sip2::Responses::Status

Sip2 Patron Information

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

Response message 98

* on-line status          - 1 char, fixed-length required field: Y or N
* checkin ok              - 1 char, fixed-length required field: Y or N
* checkout ok             - 1 char, fixed-length required field: Y or N
* ACS renewal policy      - 1 char, fixed-length required field: Y or N
* status update ok        - 1 char, fixed-length required field: Y or N
* off-line ok             - 1 char, fixed-length required field: Y or N
* timeout period          - 3 char, fixed-length required field
* retries allowed         - 3 char, fixed-length required field
* date / time sync        - 18 char, fixed-length required field: YYYYMMDDZZZZHHMMSS
* protocol version        - 4 char, fixed-length required field: x.xx
* institution ID     - AO - variable-length required field
* library name       - AM - variable-length optional field
* supported messages - BX - variable-length required field
* terminal location  - AN - variable-length optional field
* screen message     - AF - variable-length optional field
* print line         - AG - variable-length optional field

Constants

FIXED_LENGTH_CHARS
RESPONSE_ID
SUPPORTED_MESSAGES

Public Instance Methods

acs_renewal_policy?() click to toggle source
# File lib/sip2/responses/status.rb, line 62
def acs_renewal_policy?
  parse_fixed_boolean 3
end
checkin_ok?() click to toggle source
# File lib/sip2/responses/status.rb, line 54
def checkin_ok?
  parse_fixed_boolean 1
end
checkout_ok?() click to toggle source
# File lib/sip2/responses/status.rb, line 58
def checkout_ok?
  parse_fixed_boolean 2
end
date_sync() click to toggle source
# File lib/sip2/responses/status.rb, line 84
def date_sync
  parse_datetime 12
end
inspect() click to toggle source
# File lib/sip2/responses/status.rb, line 121
def inspect
  format(
    '#<%<class_name>s:0x%<object_id>p @online="%<online>s"' \
    ' @protocol_version="%<protocol_version>s"',
    class_name: self.class.name,
    object_id: object_id,
    online: online?,
    protocol_version: protocol_version
  )
end
institution_id() click to toggle source
# File lib/sip2/responses/status.rb, line 93
def institution_id
  parse_text 'AO'
end
library_name() click to toggle source
# File lib/sip2/responses/status.rb, line 97
def library_name
  parse_text 'AM'
end
offline_ok?() click to toggle source
# File lib/sip2/responses/status.rb, line 70
def offline_ok?
  parse_fixed_boolean 5
end
online?() click to toggle source
# File lib/sip2/responses/status.rb, line 50
def online?
  parse_fixed_boolean 0
end
print_line() click to toggle source
protocol_version() click to toggle source
# File lib/sip2/responses/status.rb, line 88
def protocol_version
  version = parse_fixed_response 30, 4
  version.to_f if version.match?(/\A\d\.\d\d\z/)
end
retries_allowed() click to toggle source
# File lib/sip2/responses/status.rb, line 79
def retries_allowed
  retries = parse_fixed_response 9, 3
  retries.to_i if retries.match?(/\A\d+\z/)
end
screen_message() click to toggle source
# File lib/sip2/responses/status.rb, line 113
def screen_message
  parse_text 'AF'
end
status_update_ok?() click to toggle source
# File lib/sip2/responses/status.rb, line 66
def status_update_ok?
  parse_fixed_boolean 4
end
supported_messages() click to toggle source
# File lib/sip2/responses/status.rb, line 101
def supported_messages
  message = parse_text('BX').to_s

  SUPPORTED_MESSAGES.each_with_object([]) do |(supported_message, index), acc|
    acc << supported_message if message[index] == 'Y'
  end
end
terminal_location() click to toggle source
# File lib/sip2/responses/status.rb, line 109
def terminal_location
  parse_text 'AN'
end
timeout_period() click to toggle source
# File lib/sip2/responses/status.rb, line 74
def timeout_period
  timeout = parse_fixed_response 6, 3
  timeout.to_i if timeout.match?(/\A\d+\z/)
end