Parent

Files

Twitter::Request

Attributes

client[R]
method[R]
path[R]
options[R]

Public Class Methods

delete(client, path, options={}) click to toggle source
    # File lib/twitter/request.rb, line 17
17:     def self.delete(client, path, options={})
18:       new(client, :delete, path, options).perform
19:     end
get(client, path, options={}) click to toggle source
   # File lib/twitter/request.rb, line 5
5:     def self.get(client, path, options={})
6:       new(client, :get, path, options).perform
7:     end
new(client, method, path, options={}) click to toggle source
    # File lib/twitter/request.rb, line 25
25:     def initialize(client, method, path, options={})
26:       @client, @method, @path, @options = client, method, path, options
27:     end
post(client, path, options={}) click to toggle source
    # File lib/twitter/request.rb, line 9
 9:     def self.post(client, path, options={})
10:       new(client, :post, path, options).perform
11:     end
put(client, path, options={}) click to toggle source
    # File lib/twitter/request.rb, line 13
13:     def self.put(client, path, options={})
14:       new(client, :put, path, options).perform
15:     end

Public Instance Methods

perform() click to toggle source
    # File lib/twitter/request.rb, line 41
41:     def perform
42:       Twitter.make_friendly(send("perform_#{method}"))
43:     end
uri() click to toggle source
    # File lib/twitter/request.rb, line 29
29:     def uri
30:       @uri ||= begin
31:         uri = URI.parse(path)
32: 
33:         if options[:query] && options[:query] != {}
34:           uri.query = to_query(options[:query])
35:         end
36: 
37:         uri.to_s
38:       end
39:     end

Private Instance Methods

perform_delete() click to toggle source
    # File lib/twitter/request.rb, line 59
59:     def perform_delete
60:       delete(uri, options[:headers])
61:     end
perform_get() click to toggle source
    # File lib/twitter/request.rb, line 47
47:     def perform_get
48:       get(uri, options[:headers])
49:     end
perform_post() click to toggle source
    # File lib/twitter/request.rb, line 51
51:     def perform_post
52:       post(uri, options[:body], options[:headers])
53:     end
perform_put() click to toggle source
    # File lib/twitter/request.rb, line 55
55:     def perform_put
56:       put(uri, options[:body], options[:headers])
57:     end
to_query(options) click to toggle source
    # File lib/twitter/request.rb, line 63
63:     def to_query(options)
64:       options.inject([]) do |collection, opt|
65:         collection << "#{opt[0]}=#{opt[1]}"
66:         collection
67:       end * '&'
68:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.