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(options = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #register_mapping_to_orcid_work(source_type, legend) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/orcid/configuration.rb', line 5 def initialize( = {}) @mapper = .fetch(:mapper) { default_mapper } @provider = .fetch(:provider) { default_provider } @authentication_model = .fetch(:authentication_model) do default_authenticaton_model end @parent_controller = .fetch(:parent_controller) do '::ApplicationController' end end |
Instance Attribute Details
#authentication_model ⇒ Object
Returns the value of attribute authentication_model.
17 18 19 |
# File 'lib/orcid/configuration.rb', line 17 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.
18 19 20 |
# File 'lib/orcid/configuration.rb', line 18 def parent_controller @parent_controller end |
#provider ⇒ Object
Returns the value of attribute provider.
16 17 18 |
# File 'lib/orcid/configuration.rb', line 16 def provider @provider end |
Instance Method Details
#register_mapping_to_orcid_work(source_type, legend) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/orcid/configuration.rb', line 20 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 |