Class: Tumble::Connection
- Inherits:
-
Object
- Object
- Tumble::Connection
- Defined in:
- lib/tumble/connection.rb
Instance Method Summary collapse
- #base_url ⇒ Object
- #delete(path, params = {}) ⇒ Object
-
#get(path, params = {}) ⇒ Object
Perform an HTTP GET request.
-
#initialize(token, secret) ⇒ Connection
constructor
A new instance of Connection.
-
#post(path, params = {}) ⇒ Object
Perform an HTTP POST request.
Constructor Details
#initialize(token, secret) ⇒ Connection
Returns a new instance of Connection.
4 5 6 7 |
# File 'lib/tumble/connection.rb', line 4 def initialize(token, secret) @token = token @secret = secret end |
Instance Method Details
#base_url ⇒ Object
9 10 11 |
# File 'lib/tumble/connection.rb', line 9 def base_url 'http://api.tumblr.com/' end |
#delete(path, params = {}) ⇒ Object
13 14 15 |
# File 'lib/tumble/connection.rb', line 13 def delete(path, params={}) request(:delete, path, params) end |
#get(path, params = {}) ⇒ Object
Perform an HTTP GET request
18 19 20 |
# File 'lib/tumble/connection.rb', line 18 def get(path, params={}) request(:get, path, params) end |
#post(path, params = {}) ⇒ Object
Perform an HTTP POST request
23 24 25 |
# File 'lib/tumble/connection.rb', line 23 def post(path, params={}) request(:post, path, params) end |