Class: Hydra::RemoteIdentifier::Configuration
- Inherits:
-
Object
- Object
- Hydra::RemoteIdentifier::Configuration
- Defined in:
- lib/hydra/remote_identifier/configuration.rb
Overview
Configuration is responsible for exposing the available RemoteServices and configuring those RemoteServices.
Instance Attribute Summary collapse
-
#remote_services ⇒ Object
readonly
Returns the value of attribute remote_services.
Instance Method Summary collapse
- #find_remote_service(service_name) ⇒ Object
-
#initialize(options = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #remote_service(service_name, *args) {|| ... } ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 |
# File 'lib/hydra/remote_identifier/configuration.rb', line 11 def initialize( = {}) @remote_service_namespace_container = .fetch(:remote_service_namespace_container, RemoteServices) @registration_builder = .fetch(:registration_builder, Registration) @remote_services = {} end |
Instance Attribute Details
#remote_services ⇒ Object (readonly)
Returns the value of attribute remote_services.
18 19 20 |
# File 'lib/hydra/remote_identifier/configuration.rb', line 18 def remote_services @remote_services end |
Instance Method Details
#find_remote_service(service_name) ⇒ Object
20 21 22 |
# File 'lib/hydra/remote_identifier/configuration.rb', line 20 def find_remote_service(service_name) remote_services.fetch(service_name.to_sym) end |
#remote_service(service_name, *args) {|| ... } ⇒ Object
28 29 30 31 32 33 |
# File 'lib/hydra/remote_identifier/configuration.rb', line 28 def remote_service(service_name, *args) remote_service = find_or_store_remote_service(service_name, *args) registration = registration_builder.new(remote_service) yield(registration) remote_service end |