Class: Boty::Slack::IM

Inherits:
Object
  • Object
show all
Includes:
URL
Defined in:
lib/boty/slack/im.rb

Instance Method Summary collapse

Methods included from URL

get, included

Instance Method Details

#open(user, parameters = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/boty/slack/im.rb', line 7

def open(user, parameters = {})
  defaults = { user: user }
  url = parameterize defaults.merge(parameters), path: ".open"
  info = URL.get(url) || {}
  Slack::Channel.new id: Hash(info["channel"])["id"], info: info
end