Class: EtCcdClient::TidamClient
- Inherits:
-
Object
- Object
- EtCcdClient::TidamClient
- Defined in:
- lib/et_ccd_client/tidam_client.rb
Instance Attribute Summary collapse
-
#service_token ⇒ Object
readonly
Returns the value of attribute service_token.
-
#user_details ⇒ Object
readonly
Returns the value of attribute user_details.
-
#user_token ⇒ Object
readonly
Returns the value of attribute user_token.
Instance Method Summary collapse
-
#initialize(config: ::EtCcdClient.config) ⇒ TidamClient
constructor
A new instance of TidamClient.
- #login(user_id: config.user_id, role: config.user_role) ⇒ Object
Constructor Details
#initialize(config: ::EtCcdClient.config) ⇒ TidamClient
Returns a new instance of TidamClient.
9 10 11 12 13 14 15 |
# File 'lib/et_ccd_client/tidam_client.rb', line 9 def initialize(config: ::EtCcdClient.config) self.config = config self.logger = config.logger self.service_token = nil self.user_token = nil self.user_details = nil end |
Instance Attribute Details
#service_token ⇒ Object
Returns the value of attribute service_token.
7 8 9 |
# File 'lib/et_ccd_client/tidam_client.rb', line 7 def service_token @service_token end |
#user_details ⇒ Object
Returns the value of attribute user_details.
7 8 9 |
# File 'lib/et_ccd_client/tidam_client.rb', line 7 def user_details @user_details end |
#user_token ⇒ Object
Returns the value of attribute user_token.
7 8 9 |
# File 'lib/et_ccd_client/tidam_client.rb', line 7 def user_token @user_token end |
Instance Method Details
#login(user_id: config.user_id, role: config.user_role) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/et_ccd_client/tidam_client.rb', line 17 def login(user_id: config.user_id, role: config.user_role) logger.tagged('EtCcdClient::IdamClient') do self.service_token = exchange_service_token self.user_token = exchange_tidam_user_token(user_id, role) self.user_details = get_user_details(user_id, role) end end |