Class: Orcid::Configuration
- Inherits:
-
Object
- Object
- Orcid::Configuration
- Defined in:
- lib/orcid/configuration.rb,
lib/orcid/configuration/provider.rb
Overview
Responsible for exposing the customization mechanism
Defined Under Namespace
Classes: Provider
Instance Attribute Summary collapse
-
#authentication_model ⇒ Object
Returns the value of attribute authentication_model.
-
#mapper ⇒ Object
readonly
Returns the value of attribute mapper.
-
#parent_controller ⇒ Object
Returns the value of attribute parent_controller.
-
#provider ⇒ Object
Returns the value of attribute provider.
Instance Method Summary collapse
-
#initialize(collaborators = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #register_mapping_to_orcid_work(source_type, legend) ⇒ Object
Constructor Details
#initialize(collaborators = {}) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 |
# File 'lib/orcid/configuration.rb', line 5 def initialize(collaborators = {}) @mapper = collaborators.fetch(:mapper) { default_mapper } @provider = collaborators.fetch(:provider) { default_provider } @authentication_model = collaborators.fetch(:authentication_model) { default_authenticaton_model } @parent_controller = collaborators.fetch(:parent_controller) { default_parent_controller } end |
Instance Attribute Details
#authentication_model ⇒ Object
Returns the value of attribute authentication_model.
13 14 15 |
# File 'lib/orcid/configuration.rb', line 13 def authentication_model @authentication_model end |
#mapper ⇒ Object (readonly)
Returns the value of attribute mapper.
4 5 6 |
# File 'lib/orcid/configuration.rb', line 4 def mapper @mapper end |
#parent_controller ⇒ Object
Returns the value of attribute parent_controller.
14 15 16 |
# File 'lib/orcid/configuration.rb', line 14 def parent_controller @parent_controller end |
#provider ⇒ Object
Returns the value of attribute provider.
12 13 14 |
# File 'lib/orcid/configuration.rb', line 12 def provider @provider end |
Instance Method Details
#register_mapping_to_orcid_work(source_type, legend) ⇒ Object
16 17 18 19 20 |
# File 'lib/orcid/configuration.rb', line 16 def register_mapping_to_orcid_work(source_type, legend) mapper.configure do |config| config.register(source: source_type, target: 'orcid/work', legend: legend) end end |