Class: Xenon::GenericCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/xenon/auth.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scheme, token: nil, params: {}) ⇒ GenericCredentials

Returns a new instance of GenericCredentials.



32
33
34
35
36
# File 'lib/xenon/auth.rb', line 32

def initialize(scheme, token: nil, params: {})
  @scheme = scheme
  @token = token
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



30
31
32
# File 'lib/xenon/auth.rb', line 30

def params
  @params
end

#schemeObject (readonly)

Returns the value of attribute scheme.



30
31
32
# File 'lib/xenon/auth.rb', line 30

def scheme
  @scheme
end

#tokenObject (readonly)

Returns the value of attribute token.



30
31
32
# File 'lib/xenon/auth.rb', line 30

def token
  @token
end

Instance Method Details

#to_sObject



38
39
40
41
42
43
# File 'lib/xenon/auth.rb', line 38

def to_s
  s = @scheme.dup
  s << ' ' << @token if @token
  s << ' ' << @params.map { |n, v| "#{n}=#{v.quote}" }.join(', ')
  s
end