Module: Slack::Web::Files

Included in:
Slack::Web
Defined in:
lib/slack/web/files.rb

Constant Summary collapse

SCOPE =
"files"

Instance Method Summary collapse

Instance Method Details

#files_delete(params = {}) ⇒ Object

Deletes a file.



7
8
9
10
11
# File 'lib/slack/web/files.rb', line 7

def files_delete(params={})
  throw ArgumentError.new("Required arguments :file missing") if params['file'].nil?
  response = @session.do_get "#{SCOPE}.delete", params
  Slack::parse_response(response)
end

#files_info(params = {}) ⇒ Object

Gets information about a team file.



14
15
16
17
18
# File 'lib/slack/web/files.rb', line 14

def files_info(params={})
  throw ArgumentError.new("Required arguments :file missing") if params['file'].nil
  response = @session.do_get "#{SCOPE}.info", params
  Slack::parse_response(response)
end

#files_list(params = {}) ⇒ Object

Lists & filters team files.



21
22
23
24
# File 'lib/slack/web/files.rb', line 21

def files_list(params={})
  response = @session.do_get "#{SCOPE}.list", params
  Slack::parse_response(response)
end

#files_upload(params = {}) ⇒ Object

Uploads or creates a file.



27
28
29
30
# File 'lib/slack/web/files.rb', line 27

def files_upload(params={})
  response = @session.do_get "#{SCOPE}.upload", params
  Slack::parse_response(response)
end