File: blocks.rb

package info (click to toggle)
ruby-twitter-oauth 0.4.94-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 152 kB
  • sloc: ruby: 446; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module TwitterOAuth
  class Client
    
    # Blocks the user specified in the ID parameter as the authenticating user. 
    # Destroys a friendship to the blocked user if it exists. 
    # Returns the blocked user in the requested format when successful.
    def block(id)
      post("/blocks/create/#{id}.json")
    end
    
    # Un-blocks the user specified in the ID parameter for the authenticating user.  
    # Returns the un-blocked user in the requested format when successful.
    def unblock(id)
      post("/blocks/destroy/#{id}.json")
    end
    
    # Returns if the authenticating user is blocking a target user.
    def blocked?(id)
      get("/blocks/exists/#{id}.json")
    end
    
    # Returns an array of user objects that the authenticating user is blocking.
    def blocking
      get("/blocks/blocking.json")
    end
    
    # Returns an array of numeric user ids the authenticating user is blocking.
    def blocking_ids
      get("/blocks/blocking/ids.json")
    end
    
  end
end