class LessonlyApi::Groups
Public Class Methods
Archive a group docs.lessonly.com/#archive-group
@param id [Integer] ID of a group to archive @return [ResourceType::Group] the response converted to a resource object
# File lib/lessonly_api/groups.rb, line 49 def archive(id) raw_result = send_put("/groups/#{id}/archive") ResourceType::Group.new(raw_result) end
Create a group docs.lessonly.com/#create-group
@param attributes [Hash] hash with group's attributes @return [ResourceType::Group] the response converted to a resource object
# File lib/lessonly_api/groups.rb, line 28 def create(attributes = {}) raw_result = send_post('/groups', attributes) ResourceType::Group.new(raw_result) end
Delete a group docs.lessonly.com/#delete-group
@param id [Integer] ID of a group to delete @return [ResourceType::Group] the response converted to a resource object
# File lib/lessonly_api/groups.rb, line 69 def delete(id) raw_result = send_delete("/groups/#{id}") ResourceType::Group.new(raw_result) end
Return a list of assignments for a given group docs.lessonly.com/#group-assignments
@param id [Integer] ID of a group @return [ResourceType::GroupAssignments] the response converted to a resource object
# File lib/lessonly_api/groups.rb, line 79 def group_assignments(id) raw_result = send_get("/groups/#{id}/assignments") raw_result.map { |el| ResourceType::GroupAssignment.new(el) } end
Retrieve all groups docs.lessonly.com/#list-groups
@return [ResourceType::Groups] the response converted to a resource object
# File lib/lessonly_api/groups.rb, line 8 def list raw_result = send_get('/groups') LessonlyApi::ResourceType::Groups.new(raw_result) end
Restore an archived group docs.lessonly.com/#restore-group
@param id [Integer] ID of a group to restore @return [ResourceType::Group] the response converted to a resource object
# File lib/lessonly_api/groups.rb, line 59 def restore(id) raw_result = send_put("/groups/#{id}/restore") ResourceType::Group.new(raw_result) end
Retrieve a listing of a groups members and managers. docs.lessonly.com/#show-group-details
@param id [Integer] ID of the group @return [ResourceType::Group] the response converted to a resource object
# File lib/lessonly_api/groups.rb, line 18 def show(id) raw_result = send_get("/groups/#{id}") LessonlyApi::ResourceType::Group.new(raw_result) end
Update a group docs.lessonly.com/#update-group
@param id [Integer] ID of a group to update @param attributes [Hash] hash with group's attributes to update @return [ResourceType::Group] the response converted to a resource object
# File lib/lessonly_api/groups.rb, line 39 def update(id, attributes = {}) raw_result = send_put("/groups/#{id}", attributes) ResourceType::Group.new(raw_result) end