Class: Orcid::RemoteWorkService
- Inherits:
-
Object
- Object
- Orcid::RemoteWorkService
- Defined in:
- app/services/orcid/remote_work_service.rb
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 = {}) ⇒ RemoteWorkService
constructor
A new instance of RemoteWorkService.
Constructor Details
#initialize(orcid_profile_id, options = {}) ⇒ RemoteWorkService
Returns a new instance of RemoteWorkService.
8 9 10 11 12 13 14 15 |
# File 'app/services/orcid/remote_work_service.rb', line 8 def initialize(orcid_profile_id, = {}) @orcid_profile_id = orcid_profile_id @request_method = .fetch(:request_method) { :get } @body = .fetch(:body) { "" } @token = .fetch(:token) { Orcid.access_token_for(orcid_profile_id) } @headers = .fetch(:headers) { default_headers } @path = .fetch(:path) { default_path } end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
7 8 9 |
# File 'app/services/orcid/remote_work_service.rb', line 7 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
7 8 9 |
# File 'app/services/orcid/remote_work_service.rb', line 7 def headers @headers end |
#orcid_profile_id ⇒ Object (readonly)
Returns the value of attribute orcid_profile_id.
7 8 9 |
# File 'app/services/orcid/remote_work_service.rb', line 7 def orcid_profile_id @orcid_profile_id end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'app/services/orcid/remote_work_service.rb', line 7 def path @path end |
#request_method ⇒ Object (readonly)
Returns the value of attribute request_method.
7 8 9 |
# File 'app/services/orcid/remote_work_service.rb', line 7 def request_method @request_method end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
7 8 9 |
# File 'app/services/orcid/remote_work_service.rb', line 7 def token @token end |
Class Method Details
.call(orcid_profile_id, options = {}) ⇒ Object
3 4 5 |
# File 'app/services/orcid/remote_work_service.rb', line 3 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
21 22 23 24 |
# File 'app/services/orcid/remote_work_service.rb', line 21 def call response = deliver response.body end |