orcid_client 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/orcid_client/api.rb +18 -11
- data/lib/orcid_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 262b026a4b9e0dd390c03f459556f81c7ef2de0a
|
4
|
+
data.tar.gz: 3760397b16157de4abe9ebb05ab4fdfb2c041615
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 308b88a81d942f42450874db098f850bb9e5fde6140100ba6f9ede0363201521c114249e6495ea6fcc707cca0b669fe1d5a8a04ef43ddbc823f654c97ae0d5cc
|
7
|
+
data.tar.gz: 7a45a1b143a1865108d3a12900d46e5f634cc20f7c3424b2a1dfa0079730757cf711345527c017c55b407547d7a859d9348a9f906d029a1004c7ca4e94368a57
|
data/Gemfile.lock
CHANGED
data/lib/orcid_client/api.rb
CHANGED
@@ -5,7 +5,8 @@ module OrcidClient
|
|
5
5
|
API_VERSION = "2.0_rc3"
|
6
6
|
|
7
7
|
def get_works(options={})
|
8
|
-
|
8
|
+
response = OpenStruct.new(body: {})
|
9
|
+
return { response.body["errors"] => [{ "title" => "Access token missing" }] } unless access_token.present?
|
9
10
|
|
10
11
|
orcid_api_url = options[:sandbox] ? 'https://api.sandbox.orcid.org' : 'https://api.orcid.org'
|
11
12
|
|
@@ -14,7 +15,8 @@ module OrcidClient
|
|
14
15
|
end
|
15
16
|
|
16
17
|
def create_work(options={})
|
17
|
-
|
18
|
+
response = OpenStruct.new(body: {})
|
19
|
+
return { response.body["errors"] => [{ "title" => "Access token missing" }] } unless access_token.present?
|
18
20
|
|
19
21
|
orcid_api_url = options[:sandbox] ? 'https://api.sandbox.orcid.org' : 'https://api.orcid.org'
|
20
22
|
|
@@ -26,8 +28,9 @@ module OrcidClient
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def update_work(options={})
|
29
|
-
|
30
|
-
return { "errors" => [{ "title" => "
|
31
|
+
response = OpenStruct.new(body: {})
|
32
|
+
return { response.body["errors"] => [{ "title" => "Access token missing" }] } unless access_token.present?
|
33
|
+
return { response.body["errors"] => [{ "title" => "Put code missing" }] } unless put_code.present?
|
31
34
|
|
32
35
|
orcid_api_url = options[:sandbox] ? 'https://api.sandbox.orcid.org' : 'https://api.orcid.org'
|
33
36
|
|
@@ -39,8 +42,9 @@ module OrcidClient
|
|
39
42
|
end
|
40
43
|
|
41
44
|
def delete_work(options={})
|
42
|
-
|
43
|
-
return { "errors" => [{ "title" => "
|
45
|
+
response = OpenStruct.new(body: {})
|
46
|
+
return { response.body["errors"] => [{ "title" => "Access token missing" }] } unless access_token.present?
|
47
|
+
return { response.body["errors"] => [{ "title" => "Put code missing" }] } unless put_code.present?
|
44
48
|
|
45
49
|
orcid_api_url = options[:sandbox] ? 'https://api.sandbox.orcid.org' : 'https://api.orcid.org'
|
46
50
|
|
@@ -62,7 +66,8 @@ module OrcidClient
|
|
62
66
|
end
|
63
67
|
|
64
68
|
def create_notification(options={})
|
65
|
-
|
69
|
+
response = OpenStruct.new(body: {})
|
70
|
+
return { response.body["errors"] => [{ "title" => "Notification access token missing" }] } unless notification_access_token.present?
|
66
71
|
|
67
72
|
orcid_api_url = options[:sandbox] ? 'https://api.sandbox.orcid.org' : 'https://api.orcid.org'
|
68
73
|
|
@@ -74,8 +79,9 @@ module OrcidClient
|
|
74
79
|
end
|
75
80
|
|
76
81
|
def delete_notification(options={})
|
77
|
-
|
78
|
-
return { "errors" => [{ "title" => "
|
82
|
+
response = OpenStruct.new(body: {})
|
83
|
+
return { response.body["errors"] => [{ "title" => "Notification access token missing" }] } unless notification_access_token.present?
|
84
|
+
return { response.body["errors"] => [{ "title" => "Put code missing" }] } unless put_code.present?
|
79
85
|
|
80
86
|
orcid_api_url = options[:sandbox] ? 'https://api.sandbox.orcid.org' : 'https://api.orcid.org'
|
81
87
|
|
@@ -84,8 +90,9 @@ module OrcidClient
|
|
84
90
|
end
|
85
91
|
|
86
92
|
def get_notification(options={})
|
87
|
-
|
88
|
-
return { "errors" => [{ "title" => "
|
93
|
+
response = OpenStruct.new(body: {})
|
94
|
+
return { response.body["errors"] => [{ "title" => "Notification access token missing" }] } unless notification_access_token.present?
|
95
|
+
return { response.body["errors"] => [{ "title" => "Put code missing" }] } unless put_code.present?
|
89
96
|
|
90
97
|
orcid_api_url = options[:sandbox] ? 'https://api.sandbox.orcid.org' : 'https://api.orcid.org'
|
91
98
|
|
data/lib/orcid_client/version.rb
CHANGED