Class: Tumble::Blog
- Inherits:
-
Object
- Object
- Tumble::Blog
- Defined in:
- lib/tumble/blog.rb
Instance Attribute Summary (collapse)
-
- (Object) name
readonly
Returns the value of attribute name.
Instance Method Summary (collapse)
-
- (Object) avatar(options = {})
You can get a blog's avatar in 9 different sizes.
-
- (Object) create_post(options = {})
Create a New Blog Post.
-
- (Object) delete_post(id)
Delete a Post.
-
- (Object) drafts
Retreive Draft Posts.
-
- (Object) edit_post(id, options = {})
Edit a Blog Post.
-
- (Object) followers(options = {})
Retrieve a Blog's Followers.
-
- (Object) info
This method returns general information about the blog, such as the title, number of posts, and other high-level data.
-
- (Blog) initialize(connection, name)
constructor
A new instance of Blog.
-
- (Object) posts(options = {})
Retrieve Published Posts.
-
- (Object) queue
Retrieve Queued Posts.
-
- (Object) reblog_post(id, reblog_key, options = {})
Reblog a Post.
-
- (Object) submissions
Retreive Submission Posts.
Constructor Details
- (Blog) initialize(connection, name)
A new instance of Blog
3 4 5 6 |
# File 'lib/tumble/blog.rb', line 3 def initialize(connection, name) @connection = connection @name = name end |
Instance Attribute Details
- (Object) name (readonly)
Returns the value of attribute name
8 9 10 |
# File 'lib/tumble/blog.rb', line 8 def name @name end |
Instance Method Details
- (Object) avatar(options = {})
You can get a blog's avatar in 9 different sizes. The default size is 64x64.
26 27 28 |
# File 'lib/tumble/blog.rb', line 26 def avatar(={}) @connection.get("/blog/#{name}/avatar", ) end |
- (Object) create_post(options = {})
Create a New Blog Post
For text posts: For photo posts: For quote posts: For link posts: For chat posts: For audio posts: For video posts:
123 124 125 |
# File 'lib/tumble/blog.rb', line 123 def create_post(={}) @connection.post("/blog/#{name}/post", ) end |
- (Object) delete_post(id)
Delete a Post
191 192 193 |
# File 'lib/tumble/blog.rb', line 191 def delete_post(id) @connection.post("/blog/#{name}/post/delete", :id => id) end |
- (Object) drafts
Retreive Draft Posts
72 73 74 |
# File 'lib/tumble/blog.rb', line 72 def drafts @connection.get("/blog/#{name}/posts/draft") end |
- (Object) edit_post(id, options = {})
Edit a Blog Post
For text posts: For photo posts: For quote posts: For link posts: For chat posts: For audio posts: For video posts:
168 169 170 |
# File 'lib/tumble/blog.rb', line 168 def edit_post(id, ={}) @connection.post("/blog/#{name}/post/edit", .merge('id' => id)) end |
- (Object) followers(options = {})
Retrieve a Blog's Followers
38 39 40 |
# File 'lib/tumble/blog.rb', line 38 def followers(={}) @connection.get("/blog/#{name}/followers", ) end |
- (Object) info
This method returns general information about the blog, such as the title, number of posts, and other high-level data.
15 16 17 |
# File 'lib/tumble/blog.rb', line 15 def info @connection.get("/blog/#{name}/info") end |
- (Object) posts(options = {})
Retrieve Published Posts
56 57 58 |
# File 'lib/tumble/blog.rb', line 56 def posts(={}) @connection.get("/blog/#{name}/posts", ) end |
- (Object) queue
Retrieve Queued Posts
64 65 66 |
# File 'lib/tumble/blog.rb', line 64 def queue @connection.get("/blog/#{name}/posts/queue") end |
- (Object) reblog_post(id, reblog_key, options = {})
Reblog a Post
181 182 183 |
# File 'lib/tumble/blog.rb', line 181 def reblog_post(id, reblog_key, ={}) @connection.post("/blog/#{name}/post/reblog", .merge('id' => id, 'reblog_key' => reblog_key)) end |
- (Object) submissions
Retreive Submission Posts
80 81 82 |
# File 'lib/tumble/blog.rb', line 80 def submissions @connection.get("/blog/#{name}/posts/submission") end |