Class: CognitoIdp::LogoutUri

Inherits:
Object
  • Object
show all
Defined in:
lib/cognito_idp/logout_uri.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client_id:, domain:, **options) ⇒ LogoutUri

Returns a new instance of LogoutUri.



7
8
9
10
11
12
13
14
15
# File 'lib/cognito_idp/logout_uri.rb', line 7

def initialize(client_id:, domain:, **options)
  @client_id = client_id
  @domain = domain
  @logout_uri = options[:logout_uri]
  @redirect_uri = options[:redirect_uri]
  @response_type = options[:response_type]
  @scope = options[:scope]
  @state = options[:state]
end

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



5
6
7
# File 'lib/cognito_idp/logout_uri.rb', line 5

def client_id
  @client_id
end

#domainObject

Returns the value of attribute domain.



5
6
7
# File 'lib/cognito_idp/logout_uri.rb', line 5

def domain
  @domain
end

#logout_uriObject

Returns the value of attribute logout_uri.



5
6
7
# File 'lib/cognito_idp/logout_uri.rb', line 5

def logout_uri
  @logout_uri
end

#redirect_uriObject

Returns the value of attribute redirect_uri.



5
6
7
# File 'lib/cognito_idp/logout_uri.rb', line 5

def redirect_uri
  @redirect_uri
end

#response_typeObject

Returns the value of attribute response_type.



5
6
7
# File 'lib/cognito_idp/logout_uri.rb', line 5

def response_type
  @response_type
end

#scopeObject

Returns the value of attribute scope.



5
6
7
# File 'lib/cognito_idp/logout_uri.rb', line 5

def scope
  @scope
end

#stateObject

Returns the value of attribute state.



5
6
7
# File 'lib/cognito_idp/logout_uri.rb', line 5

def state
  @state
end

Instance Method Details

#to_sObject



17
18
19
20
21
# File 'lib/cognito_idp/logout_uri.rb', line 17

def to_s
  URI("https://#{domain}/logout").tap do |uri|
    uri.query = URI.encode_www_form(params)
  end.to_s
end