Class: Slackr::Connection
- Inherits:
-
Object
- Object
- Slackr::Connection
- Defined in:
- lib/slackr/connection.rb
Instance Attribute Summary collapse
-
#http ⇒ Object
Returns the value of attribute http.
-
#options ⇒ Object
Returns the value of attribute options.
-
#team ⇒ Object
Returns the value of attribute team.
-
#token ⇒ Object
Returns the value of attribute token.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
- #base_url ⇒ Object
- #http_request(request) ⇒ Object
- #init ⇒ Object
-
#initialize(team, token, options = {}) ⇒ Connection
constructor
A new instance of Connection.
- #uri_request_uri ⇒ Object
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, ={}) @team, @token, @options = team, token, end |
Instance Attribute Details
#http ⇒ Object
Returns the value of attribute http.
14 15 16 |
# File 'lib/slackr/connection.rb', line 14 def http @http end |
#options ⇒ Object
Returns the value of attribute options.
14 15 16 |
# File 'lib/slackr/connection.rb', line 14 def @options end |
#team ⇒ Object
Returns the value of attribute team.
14 15 16 |
# File 'lib/slackr/connection.rb', line 14 def team @team end |
#token ⇒ Object
Returns the value of attribute token.
14 15 16 |
# File 'lib/slackr/connection.rb', line 14 def token @token end |
#uri ⇒ Object
Returns the value of attribute uri.
14 15 16 |
# File 'lib/slackr/connection.rb', line 14 def uri @uri end |
Instance Method Details
#base_url ⇒ Object
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 |
#init ⇒ Object
20 21 22 23 24 |
# File 'lib/slackr/connection.rb', line 20 def init setup_connection return self end |
#uri_request_uri ⇒ Object
30 31 32 |
# File 'lib/slackr/connection.rb', line 30 def uri_request_uri uri.request_uri end |