Class: Dor::StaticConfig::FedoraConfig
- Inherits:
-
Object
- Object
- Dor::StaticConfig::FedoraConfig
- Defined in:
- lib/dor/static_config/fedora_config.rb
Overview
Represents the configuration for Fedora 3
Instance Method Summary collapse
- #client ⇒ Object
- #configure(&block) ⇒ Object
-
#initialize(hash) ⇒ FedoraConfig
constructor
A new instance of FedoraConfig.
-
#safeurl ⇒ Object
The url without the username or password.
- #url(new_value = nil) ⇒ Object
Constructor Details
#initialize(hash) ⇒ FedoraConfig
Returns a new instance of FedoraConfig.
9 10 11 |
# File 'lib/dor/static_config/fedora_config.rb', line 9 def initialize(hash) @url = hash.fetch(:url) end |
Instance Method Details
#client ⇒ Object
17 18 19 |
# File 'lib/dor/static_config/fedora_config.rb', line 17 def client CertificateAuthenticatedRestResourceFactory.create(url) end |
#configure(&block) ⇒ Object
13 14 15 |
# File 'lib/dor/static_config/fedora_config.rb', line 13 def configure(&block) instance_eval(&block) end |
#safeurl ⇒ Object
The url without the username or password
27 28 29 30 31 32 33 |
# File 'lib/dor/static_config/fedora_config.rb', line 27 def safeurl fedora_uri = URI.parse(url) fedora_uri.user = fedora_uri.password = nil fedora_uri.to_s rescue URI::InvalidURIError nil end |
#url(new_value = nil) ⇒ Object
21 22 23 24 |
# File 'lib/dor/static_config/fedora_config.rb', line 21 def url(new_value = nil) @url = new_value if new_value @url end |