Class: RequestSandboxAuthorizationCode
- Inherits:
-
Object
- Object
- RequestSandboxAuthorizationCode
- Defined in:
- lib/orcid/spec_support.rb
Instance Attribute Summary collapse
-
#access_scope ⇒ Object
readonly
Returns the value of attribute access_scope.
-
#authorization_code ⇒ Object
readonly
Returns the value of attribute authorization_code.
-
#authorize_url ⇒ Object
readonly
Returns the value of attribute authorize_url.
-
#cookies ⇒ Object
writeonly
Sets the attribute cookies.
-
#login_url ⇒ Object
readonly
Returns the value of attribute login_url.
-
#oauth_redirect_uri ⇒ Object
readonly
Returns the value of attribute oauth_redirect_uri.
-
#orcid_client_id ⇒ Object
readonly
Returns the value of attribute orcid_client_id.
-
#orcid_client_secret ⇒ Object
readonly
Returns the value of attribute orcid_client_secret.
Class Method Summary collapse
Instance Method Summary collapse
- #call(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ RequestSandboxAuthorizationCode
constructor
A new instance of RequestSandboxAuthorizationCode.
Constructor Details
#initialize(options = {}) ⇒ RequestSandboxAuthorizationCode
Returns a new instance of RequestSandboxAuthorizationCode.
11 12 13 14 15 16 17 18 |
# File 'lib/orcid/spec_support.rb', line 11 def initialize( = {}) @orcid_client_id = .fetch(:orcid_client_id) { Orcid.provider.id } @orcid_client_secret = .fetch(:orcid_client_secret) { Orcid.provider.secret } @login_url = .fetch(:login_url) { Orcid.provider.signin_via_json_url } @authorize_url = .fetch(:authorize_url) { Orcid.provider. } @oauth_redirect_uri = .fetch(:oauth_redirect_uri) { 'https://developers.google.com/oauthplayground' } @access_scope = .fetch(:scope) { Orcid.provider.authentication_scope } end |
Instance Attribute Details
#access_scope ⇒ Object (readonly)
Returns the value of attribute access_scope.
8 9 10 |
# File 'lib/orcid/spec_support.rb', line 8 def access_scope @access_scope end |
#authorization_code ⇒ Object (readonly)
Returns the value of attribute authorization_code.
9 10 11 |
# File 'lib/orcid/spec_support.rb', line 9 def @authorization_code end |
#authorize_url ⇒ Object (readonly)
Returns the value of attribute authorize_url.
8 9 10 |
# File 'lib/orcid/spec_support.rb', line 8 def @authorize_url end |
#cookies=(value) ⇒ Object
Sets the attribute cookies
29 30 31 |
# File 'lib/orcid/spec_support.rb', line 29 def (value) @cookies = value end |
#login_url ⇒ Object (readonly)
Returns the value of attribute login_url.
8 9 10 |
# File 'lib/orcid/spec_support.rb', line 8 def login_url @login_url end |
#oauth_redirect_uri ⇒ Object (readonly)
Returns the value of attribute oauth_redirect_uri.
9 10 11 |
# File 'lib/orcid/spec_support.rb', line 9 def oauth_redirect_uri @oauth_redirect_uri end |
#orcid_client_id ⇒ Object (readonly)
Returns the value of attribute orcid_client_id.
9 10 11 |
# File 'lib/orcid/spec_support.rb', line 9 def orcid_client_id @orcid_client_id end |
#orcid_client_secret ⇒ Object (readonly)
Returns the value of attribute orcid_client_secret.
9 10 11 |
# File 'lib/orcid/spec_support.rb', line 9 def orcid_client_secret @orcid_client_secret end |
Class Method Details
.call(options = {}, config = {}) ⇒ Object
4 5 6 |
# File 'lib/orcid/spec_support.rb', line 4 def self.call( = {}, config = {}) new(config).call() end |
Instance Method Details
#call(options = {}) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/orcid/spec_support.rb', line 20 def call( = {}) orcid_profile_id = .fetch(:orcid_profile_id) { ENV['ORCID_CLAIMED_PROFILE_ID'] } password = .fetch(:password) { ENV['ORCID_CLAIMED_PROFILE_PASSWORD'] } login_to_orcid(orcid_profile_id, password) end |