Class: Ezid::Configuration Private
- Inherits:
-
Object
- Object
- Ezid::Configuration
- Defined in:
- lib/ezid/configuration.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
EZID client configuration.
Use ‘Ezid::Client.configure` to set values.
Constant Summary collapse
- HOST =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
"ezid.cdlib.org".freeze
- PORT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
443
- TIMEOUT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
300
Instance Attribute Summary collapse
-
#default_shoulder ⇒ Object
private
Default shoulder for minting (scheme + NAAN + shoulder).
-
#host ⇒ Object
private
EZID host name.
- #logger ⇒ Object private
-
#password ⇒ Object
private
EZID password.
-
#port ⇒ Object
private
EZID TCP/IP port.
-
#retry_interval ⇒ Object
private
Interval in seconds to wait between retries of failed requests.
-
#timeout ⇒ Object
private
HTTP read timeout (seconds).
-
#user ⇒ Object
private
EZID user name.
Instance Method Summary collapse
- #identifier ⇒ Object private
-
#initialize ⇒ Configuration
constructor
private
A new instance of Configuration.
- #inspect ⇒ Object private
- #metadata ⇒ Object private
- #use_ssl ⇒ Object private
- #use_ssl= ⇒ Object private
Constructor Details
#initialize ⇒ Configuration
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Configuration.
44 45 46 47 48 49 50 51 52 |
# 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 |
Instance Attribute Details
#default_shoulder ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Default shoulder for minting (scheme + NAAN + shoulder)
37 38 39 |
# File 'lib/ezid/configuration.rb', line 37 def default_shoulder @default_shoulder end |
#host ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
EZID host name
18 19 20 |
# File 'lib/ezid/configuration.rb', line 18 def host @host end |
#logger ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
60 61 62 |
# File 'lib/ezid/configuration.rb', line 60 def logger @logger ||= Logger.new(STDERR) end |
#password ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
EZID password
30 31 32 |
# File 'lib/ezid/configuration.rb', line 30 def password @password end |
#port ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
EZID TCP/IP port
21 22 23 |
# File 'lib/ezid/configuration.rb', line 21 def port @port end |
#retry_interval ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Interval in seconds to wait between retries of failed requests
42 43 44 |
# File 'lib/ezid/configuration.rb', line 42 def retry_interval @retry_interval end |
#timeout ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
HTTP read timeout (seconds)
24 25 26 |
# File 'lib/ezid/configuration.rb', line 24 def timeout @timeout end |
#user ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
EZID user name
27 28 29 |
# File 'lib/ezid/configuration.rb', line 27 def user @user end |
Instance Method Details
#identifier ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
64 65 66 |
# File 'lib/ezid/configuration.rb', line 64 def identifier Identifier end |
#inspect ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
54 55 56 57 58 |
# 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 |
#metadata ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
68 69 70 |
# File 'lib/ezid/configuration.rb', line 68 def Metadata end |
#use_ssl ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
72 73 74 75 76 |
# 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= ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
78 79 80 81 |
# 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 |