Class: Xenon::GenericCredentials
- Inherits:
-
Object
- Object
- Xenon::GenericCredentials
- Defined in:
- lib/xenon/auth.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(scheme, token: nil, params: {}) ⇒ GenericCredentials
constructor
A new instance of GenericCredentials.
- #to_s ⇒ Object
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
#params ⇒ Object (readonly)
Returns the value of attribute params.
30 31 32 |
# File 'lib/xenon/auth.rb', line 30 def params @params end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
30 31 32 |
# File 'lib/xenon/auth.rb', line 30 def scheme @scheme end |
#token ⇒ Object (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_s ⇒ Object
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 |