lib/d2d/client/session.rb
def authenticate!(force = false)
        return @patron if @patron && !force

        anon = @config.patron_id.gsub(/.(?=\d{4})/, '#')
        req = D2D::Client::Authentication.new(@config.to_h)
        begin
          resp = make_request(req)
        rescue StandardError => e
          @logger.warn("Unable to complete authentication request for patron #{anon}: #{e}")
          raise e
        end

        @logger.warn("Unable to create D2D session for #{anon}: #{resp.error_message || '(unknown)'}")
        raise(StandardError, resp.error_message) if resp.problem?

        @patron = resp.patron
      end
# Authenticaties the user (based on the `patron_id`
# parameter in the constructor) against the D2D web service.
#
# This will be a no-op if the patron is already authenticated.
# @see D2D::Client::Patron
Authenticaties the user (based on the `patron_id`
parameter in the constructor) against the D2D web service.

This will be a no-op if the patron is already authenticated.
Authenticaties the user ( based on the ` patron_id ` parameter in the constructor ) against the D2D web service . This will be a no - op if the patron is already authenticated .
def authenticate!(force = false)
        return @patron if @patron && !force
        anon = @config.patron_id.gsub(/.(?=\d{4})/, '#')
        req = D2D::Client::Authentication.new(@config.to_h)
        begin
          resp = make_request(req)
        rescue StandardError => e
          @logger.warn("Unable to complete authentication request for patron #{anon}: #{e}")
          raise e
        end
        @logger.warn("Unable to create D2D session for #{anon}: #{resp.error_message || '(unknown)'}")
        raise(StandardError, resp.error_message) if resp.problem?
        @patron = resp.patron
      end
def authenticate! ( force = false ) return @patron if @patron && ! force anon = @config . patron_id . gsub ( / .(?= \d {4}) / , '#' ) req = D2D :: Client :: Authentication . new ( @config . to_h ) begin resp = make_request ( req ) rescue StandardError => e @logger . warn ( "Unable to complete authentication request for patron #{anon}: #{e}" ) raise e end @logger . warn ( "Unable to create D2D session for #{anon}: #{resp.error_message || '(unknown)'}" ) raise ( StandardError , resp . error_message ) if resp . problem? @patron = resp . patron end
Authenticaties the user (based on the `patron_id`
parameter in the constructor) against the D2D web service.
Authenticaties the user ( based on the ` patron_id ` parameter in the constructor ) against the D2D web service .
force
see
None