class SlackbotFrd::SlackMethods::RtmStart

Public Class Methods

new(token) click to toggle source
# File lib/slackbot_frd/slack_methods/rtm_start.rb, line 16
def initialize(token)
  @token = token
end
wss_url(token) click to toggle source
# File lib/slackbot_frd/slack_methods/rtm_start.rb, line 10
def self.wss_url(token)
  r = RtmStart.new(token)
  r.connect
  r.wss_url
end

Public Instance Methods

connect() click to toggle source
# File lib/slackbot_frd/slack_methods/rtm_start.rb, line 20
def connect
  @response = JSON.parse(self.class.post('', :body => { token: @token } ).body)
  ValidateSlack.response(@response)
  @response
end
wss_url() click to toggle source
# File lib/slackbot_frd/slack_methods/rtm_start.rb, line 26
def wss_url
  #return "ERR" unless @response.has_key?("url")
  @response['url']
end