Class: Orcid::Remote::WorkService
- Inherits:
-
Object
- Object
- Orcid::Remote::WorkService
- Defined in:
- app/services/orcid/remote/work_service.rb
Overview
Responsible for interacting with the Orcid works endpoint
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#orcid_profile_id ⇒ Object
readonly
Returns the value of attribute orcid_profile_id.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#request_method ⇒ Object
readonly
Returns the value of attribute request_method.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Class Method Summary collapse
Instance Method Summary collapse
-
#call ⇒ Object
:post will append works to the Orcid Profile :put will replace the existing Orcid Profile works with the payload :get will retrieve the Orcid Profile support.orcid.org/knowledgebase/articles/177528-add-works-technical-developer.
-
#initialize(orcid_profile_id, options = {}) ⇒ WorkService
constructor
A new instance of WorkService.
Constructor Details
#initialize(orcid_profile_id, options = {}) ⇒ WorkService
Returns a new instance of WorkService.
13 14 15 16 17 18 19 20 |
# File 'app/services/orcid/remote/work_service.rb', line 13 def initialize(orcid_profile_id, = {}) @orcid_profile_id = orcid_profile_id @request_method = .fetch(:request_method) { :get } @body = .fetch(:body) { '' } @token = .fetch(:token) { default_token } @headers = .fetch(:headers) { default_headers } @path = .fetch(:path) { default_path } end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
10 11 12 |
# File 'app/services/orcid/remote/work_service.rb', line 10 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
10 11 12 |
# File 'app/services/orcid/remote/work_service.rb', line 10 def headers @headers end |
#orcid_profile_id ⇒ Object (readonly)
Returns the value of attribute orcid_profile_id.
10 11 12 |
# File 'app/services/orcid/remote/work_service.rb', line 10 def orcid_profile_id @orcid_profile_id end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'app/services/orcid/remote/work_service.rb', line 10 def path @path end |
#request_method ⇒ Object (readonly)
Returns the value of attribute request_method.
10 11 12 |
# File 'app/services/orcid/remote/work_service.rb', line 10 def request_method @request_method end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
10 11 12 |
# File 'app/services/orcid/remote/work_service.rb', line 10 def token @token end |
Class Method Details
.call(orcid_profile_id, options = {}) ⇒ Object
6 7 8 |
# File 'app/services/orcid/remote/work_service.rb', line 6 def self.call(orcid_profile_id, = {}) new(orcid_profile_id, ).call end |
Instance Method Details
#call ⇒ Object
:post will append works to the Orcid Profile :put will replace the existing Orcid Profile works with the payload :get will retrieve the Orcid Profile support.orcid.org/knowledgebase/articles/177528-add-works-technical-developer
26 27 28 29 |
# File 'app/services/orcid/remote/work_service.rb', line 26 def call response = deliver response.body end |