Class: OpenApi::OAuthFlow

Inherits:
Object
  • Object
show all
Includes:
EquatableAsContent
Defined in:
lib/open_api/o_auth_flow.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EquatableAsContent

#==

Constructor Details

#initialize(authorization_url:, token_url:, refresh_url: nil, scopes:) ⇒ OAuthFlow

Returns a new instance of OAuthFlow.



8
9
10
11
12
13
# File 'lib/open_api/o_auth_flow.rb', line 8

def initialize(authorization_url:, token_url:, refresh_url: nil, scopes:)
  self.authorization_url = authorization_url
  self.token_url = token_url
  self.refresh_url = refresh_url
  self.scopes = scopes.with_indifferent_access
end

Instance Attribute Details

#authorization_urlObject

Returns the value of attribute authorization_url.



6
7
8
# File 'lib/open_api/o_auth_flow.rb', line 6

def authorization_url
  @authorization_url
end

#refresh_urlObject

Returns the value of attribute refresh_url.



6
7
8
# File 'lib/open_api/o_auth_flow.rb', line 6

def refresh_url
  @refresh_url
end

#scopesObject

Returns the value of attribute scopes.



6
7
8
# File 'lib/open_api/o_auth_flow.rb', line 6

def scopes
  @scopes
end

#token_urlObject

Returns the value of attribute token_url.



6
7
8
# File 'lib/open_api/o_auth_flow.rb', line 6

def token_url
  @token_url
end

Class Method Details

.load(hash) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/open_api/o_auth_flow.rb', line 15

def self.load(hash)
  return unless hash

  new(
    authorization_url: hash["authorizationUrl"],
    token_url: hash["tokenUrl"],
    refresh_url: hash["refreshUrl"],
    scopes: hash["scopes"],
  )
end