Class: Coach4rb::Proxy::Access
Overview
This class provides a general access proxy for the cyber coach service. It is used to have global access to the cuber coach service in the perspective of a specific user.
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(username, password, coach) ⇒ Access
constructor
Creates an access proxy which provides global access to the cyber coach in the scope of the given user credentials.
-
#proxy_options ⇒ Hash
Returns an hash with basic auth http options.
Methods inherited from Base
Methods included from Mixin::BasicAuth
Constructor Details
#initialize(username, password, coach) ⇒ Access
Creates an access proxy which provides global access to the cyber coach in the scope of the given user credentials.
93 94 95 96 97 98 |
# File 'lib/coach4rb/proxy.rb', line 93 def initialize(username, password, coach) @username = username @password = password @coach = coach @base64 = basic_auth_encryption(@username, @password) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Coach4rb::Proxy::Base
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
84 85 86 |
# File 'lib/coach4rb/proxy.rb', line 84 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
84 85 86 |
# File 'lib/coach4rb/proxy.rb', line 84 def username @username end |
Instance Method Details
#proxy_options ⇒ Hash
Returns an hash with basic auth http options.
104 105 106 |
# File 'lib/coach4rb/proxy.rb', line 104 def {authorization: @base64} end |