summaryrefslogtreecommitdiff
path: root/lib/mattermost/client.rb
diff options
context:
space:
mode:
authorRegis <boudinot.regis@yahoo.com>2017-01-25 14:01:44 -0700
committerRegis <boudinot.regis@yahoo.com>2017-01-25 14:01:44 -0700
commitd4b2f4dd8332701c2df0003a213b34abe0163599 (patch)
treeec868cb769c6656bbcb4b42b65710ab72717598e /lib/mattermost/client.rb
parent5348985015cd0f3163ed7617eb86df63396db16b (diff)
parent112f9710b65fe830a058366cde1734a2928764de (diff)
downloadgitlab-ce-pipeline_index_vue_error_state.tar.gz
Merge branch 'master' into pipeline_index_vue_error_statepipeline_index_vue_error_state
Diffstat (limited to 'lib/mattermost/client.rb')
-rw-r--r--lib/mattermost/client.rb22
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/mattermost/client.rb b/lib/mattermost/client.rb
index ec2903b7ec6..e55c0d6ac49 100644
--- a/lib/mattermost/client.rb
+++ b/lib/mattermost/client.rb
@@ -8,21 +8,31 @@ module Mattermost
@user = user
end
- private
-
def with_session(&blk)
Mattermost::Session.new(user).with_session(&blk)
end
- def json_get(path, options = {})
+ private
+
+ # Should be used in a session manually
+ def get(session, path, options = {})
+ json_response session.get(path, options)
+ end
+
+ # Should be used in a session manually
+ def post(session, path, options = {})
+ json_response session.post(path, options)
+ end
+
+ def session_get(path, options = {})
with_session do |session|
- json_response session.get(path, options)
+ get(session, path, options)
end
end
- def json_post(path, options = {})
+ def session_post(path, options = {})
with_session do |session|
- json_response session.post(path, options)
+ post(session, path, options)
end
end