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