Class: Unit::ApiToken::Customer::CreateTokenUsingJwtRequest
- Inherits:
-
Object
- Object
- Unit::ApiToken::Customer::CreateTokenUsingJwtRequest
- Defined in:
- lib/unit/models/api_token/customer/create_token_using_jwt_request.rb
Instance Attribute Summary collapse
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#jwt_token ⇒ Object
readonly
Returns the value of attribute jwt_token.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(customer_id, scope, jwt_token = nil) ⇒ CreateTokenUsingJwtRequest
constructor
A new instance of CreateTokenUsingJwtRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(customer_id, scope, jwt_token = nil) ⇒ CreateTokenUsingJwtRequest
Returns a new instance of CreateTokenUsingJwtRequest.
13 14 15 16 17 |
# File 'lib/unit/models/api_token/customer/create_token_using_jwt_request.rb', line 13 def initialize(customer_id, scope, jwt_token = nil) @customer_id = customer_id @scope = scope @jwt_token = jwt_token end |
Instance Attribute Details
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
9 10 11 |
# File 'lib/unit/models/api_token/customer/create_token_using_jwt_request.rb', line 9 def customer_id @customer_id end |
#jwt_token ⇒ Object (readonly)
Returns the value of attribute jwt_token.
9 10 11 |
# File 'lib/unit/models/api_token/customer/create_token_using_jwt_request.rb', line 9 def jwt_token @jwt_token end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
9 10 11 |
# File 'lib/unit/models/api_token/customer/create_token_using_jwt_request.rb', line 9 def scope @scope end |
Instance Method Details
#to_json_api ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/unit/models/api_token/customer/create_token_using_jwt_request.rb', line 19 def to_json_api result = { data: { type: "customerToken", attributes: { scope: scope&.join(" "), jwtToken: jwt_token } } } result[:data][:attributes].compact! result.to_json end |