Class: Tumble::Client
- Inherits:
-
Object
- Object
- Tumble::Client
- Defined in:
- lib/tumble/client.rb
Instance Method Summary collapse
- #blog(name) ⇒ Object
-
#dashboard(options = {}) ⇒ Object
Retrieve a User’s Dashboard.
-
#follow(url) ⇒ Object
Follow a Blog.
-
#following(options = {}) ⇒ Object
Retrieve the Blogs a User Is Following.
-
#initialize(access_token, access_secret) ⇒ Client
constructor
Initialize a client to use for making requests.
-
#like(id, reblog_key) ⇒ Object
Like a Post.
-
#likes(options = {}) ⇒ Object
Retrieve a User’s Likes.
-
#unfollow(url) ⇒ Object
Unfollow a Blog.
-
#unlike(id, reblog_key) ⇒ Object
Unlike a Post.
-
#user_info ⇒ Object
Get Info for the Authenticated User.
Constructor Details
#initialize(access_token, access_secret) ⇒ Client
Initialize a client to use for making requests
11 12 13 |
# File 'lib/tumble/client.rb', line 11 def initialize(access_token, access_secret) @connection = Connection.new(access_token, access_secret) end |
Instance Method Details
#blog(name) ⇒ Object
15 16 17 |
# File 'lib/tumble/client.rb', line 15 def blog(name) Blog.new(@connection, name) end |
#dashboard(options = {}) ⇒ Object
Retrieve a User’s Dashboard
39 40 41 |
# File 'lib/tumble/client.rb', line 39 def dashboard(={}) @connection.get('/user/dashboard').response end |
#follow(url) ⇒ Object
Follow a Blog
73 74 75 |
# File 'lib/tumble/client.rb', line 73 def follow(url) @connection.post('/user/follow', :url => url).response end |
#following(options = {}) ⇒ Object
Retrieve the Blogs a User Is Following
63 64 65 |
# File 'lib/tumble/client.rb', line 63 def following(={}) @connection.get('/user/following').response end |
#like(id, reblog_key) ⇒ Object
Like a Post
94 95 96 |
# File 'lib/tumble/client.rb', line 94 def like(id, reblog_key) @connection.post('/user/like', :id => id, :reblog_key => reblog_key).response end |
#likes(options = {}) ⇒ Object
Retrieve a User’s Likes
51 52 53 |
# File 'lib/tumble/client.rb', line 51 def likes(={}) @connection.get('/user/likes').response end |
#unfollow(url) ⇒ Object
Unfollow a Blog
83 84 85 |
# File 'lib/tumble/client.rb', line 83 def unfollow(url) @connection.post('/user/unfollow', :url => url).response end |
#unlike(id, reblog_key) ⇒ Object
Unlike a Post
105 106 107 |
# File 'lib/tumble/client.rb', line 105 def unlike(id, reblog_key) @connection.post('/user/unlike', :id => id, :reblog_key => reblog_key).response end |
#user_info ⇒ Object
Get Info for the Authenticated User
23 24 25 |
# File 'lib/tumble/client.rb', line 23 def user_info @connection.post('/user/info').response end |