Class: MultiAuthSample::OAuthROPCGCredentials
- Inherits:
-
Object
- Object
- MultiAuthSample::OAuthROPCGCredentials
- Defined in:
- lib/multi_auth_sample/http/auth/o_auth_ropcg.rb
Overview
Data class for OAuthROPCGCredentials.
Instance Attribute Summary collapse
-
#o_auth_client_id ⇒ Object
readonly
Returns the value of attribute o_auth_client_id.
-
#o_auth_client_secret ⇒ Object
readonly
Returns the value of attribute o_auth_client_secret.
-
#o_auth_password ⇒ Object
readonly
Returns the value of attribute o_auth_password.
-
#o_auth_token ⇒ Object
readonly
Returns the value of attribute o_auth_token.
-
#o_auth_username ⇒ Object
readonly
Returns the value of attribute o_auth_username.
Instance Method Summary collapse
- #clone_with(o_auth_client_id: nil, o_auth_client_secret: nil, o_auth_username: nil, o_auth_password: nil, o_auth_token: nil) ⇒ Object
-
#initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_username:, o_auth_password:, o_auth_token: nil) ⇒ OAuthROPCGCredentials
constructor
A new instance of OAuthROPCGCredentials.
Constructor Details
#initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_username:, o_auth_password:, o_auth_token: nil) ⇒ OAuthROPCGCredentials
Returns a new instance of OAuthROPCGCredentials.
90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/multi_auth_sample/http/auth/o_auth_ropcg.rb', line 90 def initialize(o_auth_client_id:, o_auth_client_secret:, o_auth_username:, o_auth_password:, o_auth_token: nil) raise ArgumentError, 'o_auth_client_id cannot be nil' if o_auth_client_id.nil? raise ArgumentError, 'o_auth_client_secret cannot be nil' if o_auth_client_secret.nil? raise ArgumentError, 'o_auth_username cannot be nil' if o_auth_username.nil? raise ArgumentError, 'o_auth_password cannot be nil' if o_auth_password.nil? @o_auth_client_id = o_auth_client_id @o_auth_client_secret = o_auth_client_secret @o_auth_username = o_auth_username @o_auth_password = o_auth_password @o_auth_token = o_auth_token end |
Instance Attribute Details
#o_auth_client_id ⇒ Object (readonly)
Returns the value of attribute o_auth_client_id.
87 88 89 |
# File 'lib/multi_auth_sample/http/auth/o_auth_ropcg.rb', line 87 def o_auth_client_id @o_auth_client_id end |
#o_auth_client_secret ⇒ Object (readonly)
Returns the value of attribute o_auth_client_secret.
87 88 89 |
# File 'lib/multi_auth_sample/http/auth/o_auth_ropcg.rb', line 87 def o_auth_client_secret @o_auth_client_secret end |
#o_auth_password ⇒ Object (readonly)
Returns the value of attribute o_auth_password.
87 88 89 |
# File 'lib/multi_auth_sample/http/auth/o_auth_ropcg.rb', line 87 def o_auth_password @o_auth_password end |
#o_auth_token ⇒ Object (readonly)
Returns the value of attribute o_auth_token.
87 88 89 |
# File 'lib/multi_auth_sample/http/auth/o_auth_ropcg.rb', line 87 def o_auth_token @o_auth_token end |
#o_auth_username ⇒ Object (readonly)
Returns the value of attribute o_auth_username.
87 88 89 |
# File 'lib/multi_auth_sample/http/auth/o_auth_ropcg.rb', line 87 def o_auth_username @o_auth_username end |
Instance Method Details
#clone_with(o_auth_client_id: nil, o_auth_client_secret: nil, o_auth_username: nil, o_auth_password: nil, o_auth_token: nil) ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/multi_auth_sample/http/auth/o_auth_ropcg.rb', line 104 def clone_with(o_auth_client_id: nil, o_auth_client_secret: nil, o_auth_username: nil, o_auth_password: nil, o_auth_token: nil) o_auth_client_id ||= self.o_auth_client_id o_auth_client_secret ||= self.o_auth_client_secret o_auth_username ||= self.o_auth_username o_auth_password ||= self.o_auth_password o_auth_token ||= self.o_auth_token OAuthROPCGCredentials.new(o_auth_client_id: o_auth_client_id, o_auth_client_secret: o_auth_client_secret, o_auth_username: o_auth_username, o_auth_password: o_auth_password, o_auth_token: o_auth_token) end |