Class: A2A::OAuthFlow::ClientCredentials
- Inherits:
-
Object
- Object
- A2A::OAuthFlow::ClientCredentials
- Defined in:
- lib/a2a/oauth_flow/client_credentials.rb
Instance Attribute Summary collapse
-
#refresh_url ⇒ Object
readonly
Returns the value of attribute refresh_url.
-
#scopes ⇒ Object
readonly
Returns the value of attribute scopes.
-
#token_url ⇒ Object
readonly
Returns the value of attribute token_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(token_url:, scopes:, refresh_url: nil) ⇒ ClientCredentials
constructor
A new instance of ClientCredentials.
- #to_h ⇒ Object
Constructor Details
#initialize(token_url:, scopes:, refresh_url: nil) ⇒ ClientCredentials
Returns a new instance of ClientCredentials.
8 9 10 11 12 |
# File 'lib/a2a/oauth_flow/client_credentials.rb', line 8 def initialize(token_url:, scopes:, refresh_url: nil) @token_url = token_url @scopes = scopes @refresh_url = refresh_url end |
Instance Attribute Details
#refresh_url ⇒ Object (readonly)
Returns the value of attribute refresh_url.
6 7 8 |
# File 'lib/a2a/oauth_flow/client_credentials.rb', line 6 def refresh_url @refresh_url end |
#scopes ⇒ Object (readonly)
Returns the value of attribute scopes.
6 7 8 |
# File 'lib/a2a/oauth_flow/client_credentials.rb', line 6 def scopes @scopes end |
#token_url ⇒ Object (readonly)
Returns the value of attribute token_url.
6 7 8 |
# File 'lib/a2a/oauth_flow/client_credentials.rb', line 6 def token_url @token_url end |
Class Method Details
.from_h(hash) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/a2a/oauth_flow/client_credentials.rb', line 14 def self.from_h(hash) new( scopes: hash.fetch("scopes"), token_url: hash.fetch("tokenUrl"), refresh_url: hash["refreshUrl"] ) end |
Instance Method Details
#to_h ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/a2a/oauth_flow/client_credentials.rb', line 22 def to_h { "tokenUrl" => token_url, "scopes" => scopes, "refreshUrl" => refresh_url }.compact end |