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
-
#email ⇒ Object
An array of Item objects (or hashes representing them) representing all items purchased by this order.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#permission_keynames ⇒ Object
Returns the value of attribute permission_keynames.
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
#email ⇒ Object
An array of Item objects (or hashes representing them) representing all items purchased by this order.
9 10 11 |
# File 'lib/levelup/requests/create_user.rb', line 9 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
10 11 12 |
# File 'lib/levelup/requests/create_user.rb', line 10 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
11 12 13 |
# File 'lib/levelup/requests/create_user.rb', line 11 def last_name @last_name end |
#permission_keynames ⇒ Object
Returns the value of attribute permission_keynames.
12 13 14 |
# File 'lib/levelup/requests/create_user.rb', line 12 def end |
Instance Method Details
#body ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/levelup/requests/create_user.rb', line 14 def body user_hash = { email: email, first_name: first_name, last_name: last_name } { user: user_hash, permission_keynames: } end |
#response_from_hash(hash) ⇒ Object
23 24 25 26 27 |
# File 'lib/levelup/requests/create_user.rb', line 23 def response_from_hash(hash) hash['user'] = OpenStruct.new(hash['user']) Responses::Success.new(hash) end |