module GroupMe::Groups
Public Instance Methods
Create a new group.
@return [Hashie::Mash] Hash representing the group @see dev.groupme.com/docs/v3#groups_create @param name [String] Name for the new group @param options [Hash] Group information @option options [String] :description Description of the group @option options [String] :image_url GroupMe
Image Service URL @option options [Boolean] :share If you pass a true value, a share URL will be generated
# File lib/groupme/groups.rb, line 48 def create_group(name, options = {}) options[:name] = name post '/groups', options end
Disband a group
@return [Boolean] Success/Failure @see dev.groupme.com/docs/v3#groups_destroy
# File lib/groupme/groups.rb, line 71 def destroy_group(group_id) post("/groups/#{group_id}/destroy").status == 200 end
List the authenticated user’s former groups.
@return [Array<Hashie::Mash>] Array of hashes representing groups. @see dev.groupme.com/docs/v3#groups_index_former @example
client = GroupMe::Client.new client.former_groups
# File lib/groupme/groups.rb, line 34 def former_groups get '/groups/former' end
Load a specific group.
@return [Hashie::Mash] Hash representing the group. @see dev.groupme.com/docs/v3#groups_show @param id [String, Integer] The ID of the group @example
client = GroupMe::Client.new client.group(32)
# File lib/groupme/groups.rb, line 23 def group(id) get "/groups/#{id}" end
List the authenticated user’s active groups.
@return [Array<Hashie::Mash>] Array of hashes representing groups. @see dev.groupme.com/docs/v3#groups_index @example
client = GroupMe::Client.new client.groups
# File lib/groupme/groups.rb, line 10 def groups get '/groups' end
Join a shared group
@return [Boolean] Success/Failure @see dev.groupme.com/docs/v3#groups_join
# File lib/groupme/groups.rb, line 79 def join_group(group_id, share_token) post("/groups/#{group_id}/join/#{share_token}").status == 200 end
Update a group after creation
@return [Hashie::Mash] Hash representing the group @see dev.groupme.com/docs/v3#groups_update @param name [Integer] Group ID @param data [Hash] Group information @option data [String] :name Name of the group @option data [String] :description Description of the group @option data [String] :image_url GroupMe
Image Service URL @option options [Boolean] :share If you pass a true value, a share URL will be generated
# File lib/groupme/groups.rb, line 63 def update_group(group_id, data) post "/groups/#{group_id}/update", data end