Class: Levelup::Requests::CreateUser
- Inherits:
-
Base
- Object
- Templates::DataParcel
- Base
- Levelup::Requests::CreateUser
- Includes:
- Templates::AppAuthenticated
- Defined in:
- lib/levelup/requests/create_user.rb
Overview
Represents a request to create a new user with the specified list of permissions.
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#permission_keynames ⇒ Object
Returns the value of attribute permission_keynames.
-
#user ⇒ Object
Returns the value of attribute user.
Attributes included from Templates::AppAuthenticated
Instance Method Summary collapse
Methods included from Templates::AppAuthenticated
Methods inherited from Base
#auth_type, #headers, instance_variables_excluded_from_hash, #send_to_api
Methods inherited from Templates::DataParcel
excluded?, #initialize, instance_variables_excluded_from_hash
Constructor Details
This class inherits a constructor from Levelup::Templates::DataParcel
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/levelup/requests/create_user.rb', line 7 def api_key @api_key end |
#permission_keynames ⇒ Object
Returns the value of attribute permission_keynames.
6 7 8 |
# File 'lib/levelup/requests/create_user.rb', line 6 def end |
#user ⇒ Object
Returns the value of attribute user.
8 9 10 |
# File 'lib/levelup/requests/create_user.rb', line 8 def user @user end |
Instance Method Details
#body ⇒ Object
10 11 12 |
# File 'lib/levelup/requests/create_user.rb', line 10 def body { api_key: api_key, user: user, permission_keynames: } end |
#response_from_hash(hash) ⇒ Object
14 15 16 17 18 |
# File 'lib/levelup/requests/create_user.rb', line 14 def response_from_hash(hash) hash['user'] = OpenStruct.new(hash['user']) Responses::Success.new(hash) end |