Class: Weibo2::Interface::Comments
- Defined in:
- lib/weibo2/interface/comments.rb
Overview
Comments API
Instance Method Summary collapse
-
#by_me(opts = {}) ⇒ Object
获取当前登录用户所发出的评论列表.
-
#create(comment, id) ⇒ Object
对一条微博进行评论.
-
#destroy(cid) ⇒ Object
no test 删除一条评论.
-
#destroy_batch(cids) ⇒ Object
根据评论ID批量删除评论.
-
#mentions(opts = {}) ⇒ Object
获取最新的提到当前登录用户的评论,即@我的评论.
-
#reply(cid, id, comment, opts = {}) ⇒ Object
no test 回复一条评论.
-
#show(id, opts = {}) ⇒ Object
根据微博ID返回某条微博的评论列表.
-
#show_batch(cids) ⇒ Object
根据评论ID批量返回评论信息.
-
#timeline(opts = {}) ⇒ Object
获取当前登录用户的最新评论包括接收到的与发出的.
-
#to_me(opts = {}) ⇒ Object
获取当前登录用户所接收到的评论列表.
Methods inherited from Base
#get, #initialize, #post, #request
Constructor Details
This class inherits a constructor from Weibo2::Interface::Base
Instance Method Details
#by_me(opts = {}) ⇒ Object
获取当前登录用户所发出的评论列表
35 36 37 |
# File 'lib/weibo2/interface/comments.rb', line 35 def by_me(opts={}) get 'comments/by_me.json', :params => opts end |
#create(comment, id) ⇒ Object
对一条微博进行评论
103 104 105 |
# File 'lib/weibo2/interface/comments.rb', line 103 def create(comment, id) post 'comments/create.json', :body => {:comment => comment, :id => id} end |
#destroy(cid) ⇒ Object
no test 删除一条评论
113 114 115 |
# File 'lib/weibo2/interface/comments.rb', line 113 def destroy(cid) post 'comments/destroy.json', :body => {:cid => cid} end |
#destroy_batch(cids) ⇒ Object
根据评论ID批量删除评论
122 123 124 |
# File 'lib/weibo2/interface/comments.rb', line 122 def destroy_batch(cids) post 'comments/destroy_batch.json', :body => {:cids => cids} end |
#mentions(opts = {}) ⇒ Object
获取最新的提到当前登录用户的评论,即@我的评论
78 79 80 |
# File 'lib/weibo2/interface/comments.rb', line 78 def mentions(opts={}) get 'comments/mentions.json', :params => opts end |
#reply(cid, id, comment, opts = {}) ⇒ Object
no test 回复一条评论
137 138 139 |
# File 'lib/weibo2/interface/comments.rb', line 137 def reply(cid, id, comment, opts={}) post 'comments/reply.json', :body => {:cid => cid, :id => id, :comment => comment}.merge(opts) end |
#show(id, opts = {}) ⇒ Object
根据微博ID返回某条微博的评论列表
21 22 23 |
# File 'lib/weibo2/interface/comments.rb', line 21 def show(id, opts={}) get 'comments/show.json', :params => {:id => id}.merge(opts) end |
#show_batch(cids) ⇒ Object
根据评论ID批量返回评论信息
87 88 89 |
# File 'lib/weibo2/interface/comments.rb', line 87 def show_batch(cids) get 'comments/show_batch.json', :params => {:cids => cids} end |
#timeline(opts = {}) ⇒ Object
获取当前登录用户的最新评论包括接收到的与发出的
63 64 65 |
# File 'lib/weibo2/interface/comments.rb', line 63 def timeline(opts={}) get 'comments/timeline.json', :params => opts end |
#to_me(opts = {}) ⇒ Object
获取当前登录用户所接收到的评论列表
50 51 52 |
# File 'lib/weibo2/interface/comments.rb', line 50 def to_me(opts={}) get 'comments/to_me.json', :params => opts end |