class Ezid::Configuration

EZID client configuration.

Use ‘Ezid::Client.configure` to set values.

@api private

Constants

HOST
PORT
TIMEOUT

Attributes

default_shoulder[RW]

Default shoulder for minting (scheme + NAAN + shoulder) @example “ark:/99999/fk4”

host[RW]

EZID host name

logger[W]

Ruby logger instance

password[RW]

EZID password

port[RW]

EZID TCP/IP port

retry_interval[RW]

Interval in seconds to wait between retries of failed requests @see Ezid::Request#execute.

timeout[RW]

HTTP read timeout (seconds)

user[RW]

EZID user name

Public Class Methods

new() click to toggle source
# File lib/ezid/configuration.rb, line 44
def initialize
  @user             = ENV["EZID_USER"]
  @password         = ENV["EZID_PASSWORD"]
  @host             = ENV["EZID_HOST"] || HOST
  @port             = ENV["EZID_PORT"] || PORT
  @timeout          = ENV["EZID_TIMEOUT"] || TIMEOUT
  @default_shoulder = ENV["EZID_DEFAULT_SHOULDER"]
  @retry_interval = ( ENV["EZID_RETRY_INTERVAL"] || 15 ).to_i
end

Public Instance Methods

identifier() click to toggle source
# File lib/ezid/configuration.rb, line 64
def identifier
  Identifier
end
inspect() click to toggle source
# File lib/ezid/configuration.rb, line 54
def inspect
  ivars = instance_variables.reject { |v| v == :@password }
                            .map { |v| "#{v}=#{instance_variable_get(v).inspect}" }
  "#<#{self.class.name} #{ivars.join(', ')}>"
end
logger() click to toggle source
# File lib/ezid/configuration.rb, line 60
def logger
  @logger ||= Logger.new(STDERR)
end
metadata() click to toggle source
# File lib/ezid/configuration.rb, line 68
def metadata
  Metadata
end
use_ssl() click to toggle source
# File lib/ezid/configuration.rb, line 72
def use_ssl
  warn "[DEPRECATION] `use_ssl` is deprecated and will be removed in ezid-client v2.0." \
       " EZID requires SSL as of April 30, 2017."
  true
end
use_ssl=(*) click to toggle source
# File lib/ezid/configuration.rb, line 78
def use_ssl=(*)
  warn "[DEPRECATION] `use_ssl=` is deprecated and will be removed in ezid-client v2.0." \
       " EZID requires SSL as of April 30, 2017."
end