Class: WorkOS::UserResponse
- Inherits:
-
Object
- Object
- WorkOS::UserResponse
- Includes:
- HashProvider
- Defined in:
- lib/workos/user_response.rb
Overview
The UserResponse class represents a User as well as an corresponding response data that can later be appended on.
Instance Attribute Summary collapse
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(user_response_json) ⇒ UserResponse
constructor
A new instance of UserResponse.
- #to_json ⇒ Object
Methods included from HashProvider
Constructor Details
#initialize(user_response_json) ⇒ UserResponse
Returns a new instance of UserResponse.
11 12 13 14 |
# File 'lib/workos/user_response.rb', line 11 def initialize(user_response_json) json = JSON.parse(user_response_json, symbolize_names: true) @user = WorkOS::User.new(json[:user].to_json) end |
Instance Attribute Details
#user ⇒ Object
Returns the value of attribute user.
9 10 11 |
# File 'lib/workos/user_response.rb', line 9 def user @user end |
Instance Method Details
#to_json ⇒ Object
16 17 18 19 20 |
# File 'lib/workos/user_response.rb', line 16 def to_json(*) { user: user.to_json, } end |