Class: Slack::API::IM

Inherits:
Base
  • Object
show all
Defined in:
lib/laziness/api/im.rb

Instance Method Summary collapse

Methods inherited from Base

parse

Instance Method Details

#allObject



4
5
6
7
# File 'lib/laziness/api/im.rb', line 4

def all
  response = request :get, 'im.list'
  Slack::Channel.parse response, 'ims'
end

#close(channel) ⇒ Object



9
10
11
# File 'lib/laziness/api/im.rb', line 9

def close(channel)
  with_nil_response { request :post, 'im.close', channel: channel }
end

#mark(channel, timestamp) ⇒ Object



13
14
15
# File 'lib/laziness/api/im.rb', line 13

def mark(channel, timestamp)
  with_nil_response { request :post, 'im.mark', channel: channel, ts: timestamp }
end

#open(user_id) ⇒ Object



17
18
19
20
# File 'lib/laziness/api/im.rb', line 17

def open(user_id)
  response = request :post, 'im.open', { user: user_id }
  Slack::Channel.parse response, 'channel'
end