Class: Etwin::Client::Auth
- Inherits:
-
Object
- Object
- Etwin::Client::Auth
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/etwin/client/auth.rb
Overview
Eternal-Twin client authentication data
Constant Summary collapse
- Guest =
T.let(new(nil), Auth)
Instance Attribute Summary collapse
-
#authorization_header ⇒ Object
readonly
Returns the value of attribute authorization_header.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #hash ⇒ Object
-
#initialize(authorization_header) ⇒ Auth
constructor
A new instance of Auth.
- #inspect ⇒ Object
- #pretty_print(pp) ⇒ Object
Constructor Details
#initialize(authorization_header) ⇒ Auth
Returns a new instance of Auth.
17 18 19 20 |
# File 'lib/etwin/client/auth.rb', line 17 def initialize() @authorization_header = T.let(, T.nilable(String)) freeze end |
Instance Attribute Details
#authorization_header ⇒ Object (readonly)
Returns the value of attribute authorization_header.
14 15 16 |
# File 'lib/etwin/client/auth.rb', line 14 def @authorization_header end |
Class Method Details
.from_token(key) ⇒ Object
60 61 62 |
# File 'lib/etwin/client/auth.rb', line 60 def from_token(key) new("Bearer #{key}") end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/etwin/client/auth.rb', line 23 def ==(other) case other when Auth @authorization_header == other. else false end end |
#hash ⇒ Object
33 34 35 |
# File 'lib/etwin/client/auth.rb', line 33 def hash [@authorization_header].hash end |
#inspect ⇒ Object
38 39 40 |
# File 'lib/etwin/client/auth.rb', line 38 def inspect PP.singleline_pp(self, String.new) end |
#pretty_print(pp) ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/etwin/client/auth.rb', line 43 def pretty_print(pp) pp.group(0, "#{self.class.name}(", ')') do pp.nest 1 do pp.breakable '' pp.text 'authorization_header=' pp.pp @authorization_header end pp.breakable '' end end |