summaryrefslogtreecommitdiff
path: root/lib/mattermost/team.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mattermost/team.rb')
-rw-r--r--lib/mattermost/team.rb14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/mattermost/team.rb b/lib/mattermost/team.rb
index 2de01eced0b..784eca6ab5a 100644
--- a/lib/mattermost/team.rb
+++ b/lib/mattermost/team.rb
@@ -1,15 +1,7 @@
module Mattermost
- class Team
- def self.all(session)
- response = session.get('/api/v3/teams/all')
-
- if response.success?
- response.parsed_response
- elsif response.parsed_response.try(:has_key?, 'message')
- raise response.parsed_response['message']
- else
- raise 'Failed to list teams'
- end
+ class Team < Client
+ def all
+ json_get('/api/v3/teams/all')
end
end
end