Module: WordpressApi::Api::Writer
- Included in:
- Client
- Defined in:
- lib/wordpress_api/api/writer.rb
Instance Method Summary collapse
- #create_comment(blog_id, post_id, content, options = {}) ⇒ Object
- #create_comment_tree(blog_id, comment_id, content, options = {}) ⇒ Object
- #create_like(blog_id, post_id, options = {}) ⇒ Object
- #create_post(blog_id, content, options = {}) ⇒ Object
- #delete_comment(blog_id, comment_id, options = {}) ⇒ Object
- #delete_like(blog_id, post_id, options = {}) ⇒ Object
- #delete_post(blog_id, post_id, options = {}) ⇒ Object
- #follow(blog_id, options = {}) ⇒ Object
- #repost(blog_id, post_id, options = {}) ⇒ Object
- #unfollow(blog_id, options = {}) ⇒ Object
Instance Method Details
#create_comment(blog_id, post_id, content, options = {}) ⇒ Object
21 22 23 24 |
# File 'lib/wordpress_api/api/writer.rb', line 21 def create_comment blog_id, post_id, content, ={} path = "/sites/#{blog_id}/posts/#{post_id}/replies/new" Mash.from_json(post path, content.to_json, ) end |
#create_comment_tree(blog_id, comment_id, content, options = {}) ⇒ Object
26 27 28 29 |
# File 'lib/wordpress_api/api/writer.rb', line 26 def create_comment_tree blog_id, comment_id, content, ={} path = "/sites/#{blog_id}/comments/#{comment_id}/replies/new" Mash.from_json(post path, content.to_json, ) end |
#create_like(blog_id, post_id, options = {}) ⇒ Object
36 37 38 39 |
# File 'lib/wordpress_api/api/writer.rb', line 36 def create_like blog_id, post_id, ={} path = "/sites/#{blog_id}/posts/#{post_id}/likes/new" Mash.from_json(post path, "", ) end |
#create_post(blog_id, content, options = {}) ⇒ Object
6 7 8 9 |
# File 'lib/wordpress_api/api/writer.rb', line 6 def create_post blog_id, content, ={} path = "/sites/#{blog_id}/posts/new" Mash.from_json(post(path, content.to_json, )) end |
#delete_comment(blog_id, comment_id, options = {}) ⇒ Object
31 32 33 34 |
# File 'lib/wordpress_api/api/writer.rb', line 31 def delete_comment blog_id, comment_id, ={} path = "/sites/#{blog_id}/comments/#{comment_id}/delete" Mash.from_json(post path, "", ) end |
#delete_like(blog_id, post_id, options = {}) ⇒ Object
41 42 43 44 |
# File 'lib/wordpress_api/api/writer.rb', line 41 def delete_like blog_id, post_id, ={} path = "/sites/#{blog_id}/posts/#{post_id}/likes/mine/delete" Mash.from_json(post path, "", ) end |
#delete_post(blog_id, post_id, options = {}) ⇒ Object
11 12 13 14 |
# File 'lib/wordpress_api/api/writer.rb', line 11 def delete_post blog_id, post_id, ={} path = "/sites/#{blog_id}/posts/#{post_id}/delete" Mash.from_json(post(path, "", )) end |
#follow(blog_id, options = {}) ⇒ Object
46 47 48 49 |
# File 'lib/wordpress_api/api/writer.rb', line 46 def follow blog_id, ={} path = "/sites/#{blog_id}/follows/new" Mash.from_json(post(path, "", )) end |