Class: Orcid::Configuration

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_modelObject

Returns the value of attribute authentication_model.



13
14
15
# File 'lib/orcid/configuration.rb', line 13

def authentication_model
  @authentication_model
end

#mapperObject (readonly)

Returns the value of attribute mapper.



4
5
6
# File 'lib/orcid/configuration.rb', line 4

def mapper
  @mapper
end

#parent_controllerObject

Returns the value of attribute parent_controller.



14
15
16
# File 'lib/orcid/configuration.rb', line 14

def parent_controller
  @parent_controller
end

#providerObject

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