Module: AllPlayers::Users
- Included in:
- Client
- Defined in:
- lib/allplayers/client/users.rb
Instance Method Summary collapse
- #user_children_list(uuid) ⇒ Object
- #user_create(email, firstname, lastname, birthday, gender, more_params = {}) ⇒ Object
- #user_create_child(parent_uuid, firstname, lastname, birthday, gender, more_params = {}) ⇒ Object
- #user_create_group(uuid, title, description, location, categories, more_params = {}) ⇒ Object
- #user_get(uuid = nil) ⇒ Object
- #user_get_email(email = nil) ⇒ Object
- #user_group_add_role(group_uuid, user_uuid, role_uuid, params = {}) ⇒ Object
- #user_groups_list(user_uuid, params = {}) ⇒ Object
- #user_join_group(group_uuid, user_uuid, role_name = nil, options = {}, webform_id = nil) ⇒ Object
- #user_leave_group(group_uuid, user_uuid) ⇒ Object
Instance Method Details
#user_children_list(uuid) ⇒ Object
22 23 24 |
# File 'lib/allplayers/client/users.rb', line 22 def user_children_list(uuid) get 'users/' + uuid.to_s() + '/children' end |
#user_create(email, firstname, lastname, birthday, gender, more_params = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/allplayers/client/users.rb', line 3 def user_create(email, firstname, lastname, birthday, gender, more_params = {}) required_params = { :email => email, :firstname => firstname, :lastname => lastname, :birthday => birthday, :gender => gender, } post 'users', required_params.merge(more_params) end |
#user_create_child(parent_uuid, firstname, lastname, birthday, gender, more_params = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/allplayers/client/users.rb', line 26 def user_create_child(parent_uuid, firstname, lastname, birthday, gender, more_params = {}) required_params = { :firstname => firstname, :lastname => lastname, :birthday => birthday, :gender => gender, } post 'users/' + parent_uuid.to_s() + '/addchild', required_params.merge(more_params) end |
#user_create_group(uuid, title, description, location, categories, more_params = {}) ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/allplayers/client/users.rb', line 52 def user_create_group(uuid, title, description, location, categories, more_params = {}) required_params = { :title => title, :description => description, :location => location, :category => categories } post 'users/' + uuid + '/creategroup', required_params.merge(more_params) end |
#user_get(uuid = nil) ⇒ Object
18 19 20 |
# File 'lib/allplayers/client/users.rb', line 18 def user_get(uuid = nil) get 'users/' + uuid.to_s() if !uuid.nil? end |
#user_get_email(email = nil) ⇒ Object
14 15 16 |
# File 'lib/allplayers/client/users.rb', line 14 def user_get_email(email = nil) get 'users', {:email => email} if !email.nil? end |
#user_group_add_role(group_uuid, user_uuid, role_uuid, params = {}) ⇒ Object
48 49 50 |
# File 'lib/allplayers/client/users.rb', line 48 def user_group_add_role(group_uuid, user_uuid, role_uuid, params = {}) post 'groups/' + group_uuid + '/addrole/' + user_uuid + '/' + role_uuid, params end |
#user_groups_list(user_uuid, params = {}) ⇒ Object
36 37 38 |
# File 'lib/allplayers/client/users.rb', line 36 def user_groups_list(user_uuid, params = {}) get 'users/' + user_uuid + '/groups', params end |
#user_join_group(group_uuid, user_uuid, role_name = nil, options = {}, webform_id = nil) ⇒ Object
40 41 42 |
# File 'lib/allplayers/client/users.rb', line 40 def user_join_group(group_uuid, user_uuid, role_name = nil, = {}, webform_id = nil) post 'groups/' + group_uuid + '/join/' + user_uuid, {:org_webform_uuid => webform_id, :role_name => role_name.to_s, :role_options => } end |
#user_leave_group(group_uuid, user_uuid) ⇒ Object
44 45 46 |
# File 'lib/allplayers/client/users.rb', line 44 def user_leave_group(group_uuid, user_uuid) post 'groups/' + group_uuid + '/leave/' + user_uuid end |