diff options
author | Jeffrey Hardy <packagethief@gmail.com> | 2009-03-24 00:27:37 -0400 |
---|---|---|
committer | Jeffrey Hardy <packagethief@gmail.com> | 2009-03-24 00:27:37 -0400 |
commit | e64e4f82d336a83388c8fd1bc0d0f2ac2d9f2790 (patch) | |
tree | fb8b3ff816c53018381590986a37501eda61cd42 /activeresource/lib | |
parent | 87891de101ea02a8a342b4a66da9435aae010ed2 (diff) | |
download | rails-e64e4f82d336a83388c8fd1bc0d0f2ac2d9f2790.tar.gz rails-e64e4f82d336a83388c8fd1bc0d0f2ac2d9f2790.tar.bz2 rails-e64e4f82d336a83388c8fd1bc0d0f2ac2d9f2790.zip |
Update ActiveResource::Connection documentation to use present tense
Diffstat (limited to 'activeresource/lib')
-rw-r--r-- | activeresource/lib/active_resource/connection.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb index 85103b53c5..80d5c95b68 100644 --- a/activeresource/lib/active_resource/connection.rb +++ b/activeresource/lib/active_resource/connection.rb @@ -95,46 +95,46 @@ module ActiveResource @password = URI.decode(@site.password) if @site.password end - # Set user for remote service. + # Sets the user for remote service. def user=(user) @user = user end - # Set password for remote service. + # Sets the password for remote service. def password=(password) @password = password end - # Set the number of seconds after which HTTP requests to the remote service should time out. + # Sets the number of seconds after which HTTP requests to the remote service should time out. def timeout=(timeout) @timeout = timeout end - # Execute a GET request. + # Executes a GET request. # Used to get (find) resources. def get(path, headers = {}) format.decode(request(:get, path, build_request_headers(headers, :get)).body) end - # Execute a DELETE request (see HTTP protocol documentation if unfamiliar). + # Executes a DELETE request (see HTTP protocol documentation if unfamiliar). # Used to delete resources. def delete(path, headers = {}) request(:delete, path, build_request_headers(headers, :delete)) end - # Execute a PUT request (see HTTP protocol documentation if unfamiliar). + # Executes a PUT request (see HTTP protocol documentation if unfamiliar). # Used to update resources. def put(path, body = '', headers = {}) request(:put, path, body.to_s, build_request_headers(headers, :put)) end - # Execute a POST request. + # Executes a POST request. # Used to create new resources. def post(path, body = '', headers = {}) request(:post, path, body.to_s, build_request_headers(headers, :post)) end - # Execute a HEAD request. + # Executes a HEAD request. # Used to obtain meta-information about resources, such as whether they exist and their size (via response headers). def head(path, headers = {}) request(:head, path, build_request_headers(headers)) @@ -142,7 +142,7 @@ module ActiveResource private - # Makes request to remote service. + # Makes a request to the remote service. def request(method, path, *arguments) logger.info "#{method.to_s.upcase} #{site.scheme}://#{site.host}:#{site.port}#{path}" if logger result = nil @@ -153,7 +153,7 @@ module ActiveResource raise TimeoutError.new(e.message) end - # Handles response and error codes from remote service. + # Handles response and error codes from the remote service. def handle_response(response) case response.code.to_i when 301,302 @@ -183,7 +183,7 @@ module ActiveResource end end - # Creates new Net::HTTP instance for communication with + # Creates new Net::HTTP instance for communication with the # remote service and resources. def http http = Net::HTTP.new(@site.host, @site.port) |