Module: Mattermost::Request
- Included in:
- Client
- Defined in:
- lib/mattermost/request.rb
Instance Method Summary collapse
- #delete(path, options = {}, &block) ⇒ Object
- #get(path, options = {}, &block) ⇒ Object
- #post(path, options = {}, &block) ⇒ Object
- #put(path, options = {}, &block) ⇒ Object
Instance Method Details
#delete(path, options = {}, &block) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/mattermost/request.rb', line 28 def delete(path, = {}, &block) connection.send(:delete) do |request| request.path = api(path) request.body = [:body] if .key? :body end end |
#get(path, options = {}, &block) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/mattermost/request.rb', line 7 def get(path, = {}, &block) puts "get #{path}, #{}" connection.send(:get) do |request| request.url api(path), end end |
#post(path, options = {}, &block) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/mattermost/request.rb', line 14 def post(path, = {}, &block) connection.send(:post) do |request| request.path = api(path) request.body = [:body] if .key? :body end end |
#put(path, options = {}, &block) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/mattermost/request.rb', line 21 def put(path, = {}, &block) connection.send(:put) do |request| request.path = api(path) request.body = [:body] if .key? :body end end |