Module: Remind101::Client::Groups
Instance Method Summary collapse
-
#create_group!(hash) ⇒ Object
Public: Creates a new group.
-
#destroy_group!(group_id) ⇒ Object
Public: Destroys an existing group.
-
#groups ⇒ Object
Public: Returns all groups for the current user.
Methods included from Rescuable
Instance Method Details
#create_group!(hash) ⇒ Object
Public: Creates a new group.
Examples
remind101.create_group! name: 'Math 101'
# => { :id => 4321, :name => "Math 101", ... }
Returns the created group.
24 25 26 |
# File 'lib/remind101/client/groups.rb', line 24 def create_group!(hash) api_post('/groups', group: hash).body end |
#destroy_group!(group_id) ⇒ Object
Public: Destroys an existing group.
Examples
remind101.destroy_group! 4321
# => { :id => 4321, :name => "Math 101", ... }
Returns the destroyed group.
37 38 39 |
# File 'lib/remind101/client/groups.rb', line 37 def destroy_group!(group_id) api_delete("/groups/#{group_id}").body end |
#groups ⇒ Object
Public: Returns all groups for the current user.
Examples
remind101.groups
# => [{ ... }]
Returns an Array of all groups.
12 13 14 |
# File 'lib/remind101/client/groups.rb', line 12 def groups api_get('/groups').body end |