Class: Slackr::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/slackr/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(team, token, options = {}) ⇒ Connection

Returns a new instance of Connection.



16
17
18
# File 'lib/slackr/connection.rb', line 16

def initialize(team, token, options={})
  @team, @token, @options = team, token, options
end

Instance Attribute Details

#httpObject

Returns the value of attribute http.



14
15
16
# File 'lib/slackr/connection.rb', line 14

def http
  @http
end

#optionsObject

Returns the value of attribute options.



14
15
16
# File 'lib/slackr/connection.rb', line 14

def options
  @options
end

#teamObject

Returns the value of attribute team.



14
15
16
# File 'lib/slackr/connection.rb', line 14

def team
  @team
end

#tokenObject

Returns the value of attribute token.



14
15
16
# File 'lib/slackr/connection.rb', line 14

def token
  @token
end

#uriObject

Returns the value of attribute uri.



14
15
16
# File 'lib/slackr/connection.rb', line 14

def uri
  @uri
end

Instance Method Details

#base_urlObject



26
27
28
# File 'lib/slackr/connection.rb', line 26

def base_url
  "https://#{@team}.slack.com"
end

#http_request(request) ⇒ Object



34
35
36
# File 'lib/slackr/connection.rb', line 34

def http_request(request)
  http.request(request)
end

#initObject



20
21
22
23
24
# File 'lib/slackr/connection.rb', line 20

def init
  validate_options
  setup_connection
  return self
end

#uri_request_uriObject



30
31
32
# File 'lib/slackr/connection.rb', line 30

def uri_request_uri
  uri.request_uri
end