Class: WeiboOAuth2::Api::V2::Favorites

Inherits:
Base
  • Object
show all
Defined in:
lib/weibo_2/api/v2/favorites.rb

Instance Method Summary collapse

Methods inherited from Base

#hashie, #initialize

Constructor Details

This class inherits a constructor from WeiboOAuth2::Api::V2::Base

Instance Method Details

#by_tags(tid, opt = {}) ⇒ Object



19
20
21
# File 'lib/weibo_2/api/v2/favorites.rb', line 19

def by_tags(tid, opt={})
  hashie get("favorites/by_tags.json", :params => {:tid => tid}.merge(opt))
end

#by_tags_ids(tid, opt = {}) ⇒ Object



27
28
29
# File 'lib/weibo_2/api/v2/favorites.rb', line 27

def by_tags_ids(tid, opt={})
  hashie get("favorites/by_tags/ids.json", :params => {:tid => tid}.merge(opt))
end

#create(id, opt = {}) ⇒ Object

write interfaces



32
33
34
# File 'lib/weibo_2/api/v2/favorites.rb', line 32

def create(id, opt={})
  hashie post("favorites/create.json", :params => {:id => id}.merge(opt))
end

#destroy(id, opt = {}) ⇒ Object



36
37
38
# File 'lib/weibo_2/api/v2/favorites.rb', line 36

def destroy(id, opt={})
  hashie post("favorites/destroy.json", :params => {:id => id}.merge(opt))
end

#destroy_batch(ids, opt = {}) ⇒ Object



40
41
42
# File 'lib/weibo_2/api/v2/favorites.rb', line 40

def destroy_batch(ids, opt={})
  hashie post("favorites/destroy_batch.json", :params => {:ids => ids}.merge(opt))
end

#favorites(opt = {}) ⇒ Object

read interfaces



7
8
9
# File 'lib/weibo_2/api/v2/favorites.rb', line 7

def favorites(opt={})
  hashie get("favorites.json", :params => opt)
end

#ids(opt = {}) ⇒ Object



11
12
13
# File 'lib/weibo_2/api/v2/favorites.rb', line 11

def ids(opt={})
  hashie get("favorites/ids.json", :params => opt)
end

#show(id, opt = {}) ⇒ Object



15
16
17
# File 'lib/weibo_2/api/v2/favorites.rb', line 15

def show(id, opt={})
  hashie get("favorites/show.json", :params => {:id => id}.merge(opt))
end

#tags(opt = {}) ⇒ Object



23
24
25
# File 'lib/weibo_2/api/v2/favorites.rb', line 23

def tags(opt={})
  hashie get("favorites/tags.json", :params => opt)
end

#tags_destroy_batch(tid, opt = {}) ⇒ Object



52
53
54
# File 'lib/weibo_2/api/v2/favorites.rb', line 52

def tags_destroy_batch(tid, opt={})
  hashie post("favorites/tags/destroy_batch.json", :params => {:tid => tid}.merge(opt))
end

#tags_update(id, tags, opt = {}) ⇒ Object



44
45
46
# File 'lib/weibo_2/api/v2/favorites.rb', line 44

def tags_update(id, tags, opt={})
  hashie post("favorites/tags/update.json", :params => {:id => id, :tags => CGI::escape(tags)}.merge(opt))
end

#tags_update_batch(tid, tag, opt = {}) ⇒ Object



48
49
50
# File 'lib/weibo_2/api/v2/favorites.rb', line 48

def tags_update_batch(tid, tag, opt={})
  hashie post("favorites/tags/update_batch.json", :params => {:tid => tid, :tag => CGI::escape(tag)}.merge(opt))
end