Class: Renren2::Interface::Share
- Defined in:
- lib/renren2/interface/share.rb
Overview
Share Interface
Instance Method Summary collapse
-
#add_comment(share_id, user_id, content, opts = {}) ⇒ Object
对某个分享进行评论.
-
#get_comments(user_id, share_id) ⇒ Object
获取某个分享的评论.
-
#share(type, opts = {}) ⇒ Object
发布分享,例如分享视频、音乐、链接、日志、相册、照片等.
Methods inherited from Base
#check_scope, #get, #initialize, #post, #request
Constructor Details
This class inherits a constructor from Renren2::Interface::Base
Instance Method Details
#add_comment(share_id, user_id, content, opts = {}) ⇒ Object
Note:
require “publish_comment、publish_share” scope
对某个分享进行评论
49 50 51 52 53 |
# File 'lib/renren2/interface/share.rb', line 49 def add_comment(share_id, user_id, content, opts={}) check_scope "publish_comment" check_scope "publish_share" post 'share.addComment', :body => {:share_id => share_id, :user_id => user_id, :content => content}.merge(opts) end |
#get_comments(user_id, share_id) ⇒ Object
Note:
require “read_user_share、read_user_comment” scope
获取某个分享的评论
33 34 35 36 37 |
# File 'lib/renren2/interface/share.rb', line 33 def get_comments(user_id, share_id) check_scope "read_user_share" check_scope "read_user_comment" post 'share.getComments', :body => {:user_id => user_id, :share_id => share_id} end |
#share(type, opts = {}) ⇒ Object
Note:
require “publish_share” scope
发布分享,例如分享视频、音乐、链接、日志、相册、照片等
21 22 23 24 |
# File 'lib/renren2/interface/share.rb', line 21 def share(type, opts={}) check_scope "publish_share" post 'share.share', :body => {:type => type}.merge(opts) end |