diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-07-16 13:00:36 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-16 13:01:23 +0100 |
commit | 0432d151647f2178ddee79979827d552447c251f (patch) | |
tree | 7c772cd260eb051cd7b80cf91468555f03db9e11 /activeresource/lib/active_resource | |
parent | f7d08acd5e0650658383e3d3f86d6ff5b49e9030 (diff) | |
download | rails-0432d151647f2178ddee79979827d552447c251f.tar.gz rails-0432d151647f2178ddee79979827d552447c251f.tar.bz2 rails-0432d151647f2178ddee79979827d552447c251f.zip |
Merge with docrails.
Diffstat (limited to 'activeresource/lib/active_resource')
-rw-r--r-- | activeresource/lib/active_resource/base.rb | 22 | ||||
-rw-r--r-- | activeresource/lib/active_resource/custom_methods.rb | 4 | ||||
-rw-r--r-- | activeresource/lib/active_resource/http_mock.rb | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index 347dbb82aa..492ab27bef 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -111,7 +111,7 @@ module ActiveResource # over HTTPS. # # Note: Some values cannot be provided in the URL passed to site. e.g. email addresses - # as usernames. In those situations you should use the seperate user and password option. + # as usernames. In those situations you should use the separate user and password option. # == Errors & Validation # # Error handling and validation is handled in much the same manner as you're used to seeing in @@ -200,7 +200,7 @@ module ActiveResource cattr_accessor :logger class << self - # Gets the URI of the REST resources to map for this class. The site variable is required + # Gets the URI of the REST resources to map for this class. The site variable is required for # Active Resource's mapping to work. def site # Not using superclass_delegating_reader because don't want subclasses to modify superclass instance @@ -226,7 +226,7 @@ module ActiveResource end # Sets the URI of the REST resources to map for this class to the value in the +site+ argument. - # The site variable is required Active Resource's mapping to work. + # The site variable is required for Active Resource's mapping to work. def site=(site) @connection = nil if site.nil? @@ -288,7 +288,7 @@ module ActiveResource end # Returns the current format, default is ActiveResource::Formats::XmlFormat. - def format # :nodoc: + def format read_inheritable_attribute("format") || ActiveResource::Formats[:xml] end @@ -298,7 +298,7 @@ module ActiveResource @timeout = timeout end - # Gets tthe number of seconds after which requests to the REST API should time out. + # Gets the number of seconds after which requests to the REST API should time out. def timeout if defined?(@timeout) @timeout @@ -426,16 +426,16 @@ module ActiveResource alias_method :set_primary_key, :primary_key= #:nodoc: - # Create a new resource instance and request to the remote service + # Creates a new resource instance and makes a request to the remote service # that it be saved, making it equivalent to the following simultaneous calls: # # ryan = Person.new(:first => 'ryan') # ryan.save # - # The newly created resource is returned. If a failure has occurred an - # exception will be raised (see save). If the resource is invalid and - # has not been saved then valid? will return <tt>false</tt>, - # while new? will still return <tt>true</tt>. + # Returns the newly created resource. If a failure has occurred an + # exception will be raised (see <tt>save</tt>). If the resource is invalid and + # has not been saved then <tt>valid?</tt> will return <tt>false</tt>, + # while <tt>new?</tt> will still return <tt>true</tt>. # # ==== Examples # Person.create(:name => 'Jeremy', :email => 'myname@nospam.com', :enabled => true) @@ -812,7 +812,7 @@ module ActiveResource # Person.delete(guys_id) # that_guy.exists? # => false def exists? - !new? && self.class.exists?(to_param, :params => prefix_options) + !new? && self.class.exists?(to_param, :params => prefix_options) end # A method to convert the the resource to an XML string. diff --git a/activeresource/lib/active_resource/custom_methods.rb b/activeresource/lib/active_resource/custom_methods.rb index 4c8699288c..770116ceb7 100644 --- a/activeresource/lib/active_resource/custom_methods.rb +++ b/activeresource/lib/active_resource/custom_methods.rb @@ -48,8 +48,8 @@ module ActiveResource # # => [{:id => 1, :name => 'Ryan'}] # # Note: the objects returned from this method are not automatically converted - # into Active Resource instances - they are ordinary Hashes. If you are expecting - # Active Resource instances, use the <tt>find</tt> class method with the + # into ActiveResource::Base instances - they are ordinary Hashes. If you are expecting + # ActiveResource::Base instances, use the <tt>find</tt> class method with the # <tt>:from</tt> option. For example: # # Person.find(:all, :from => :active) diff --git a/activeresource/lib/active_resource/http_mock.rb b/activeresource/lib/active_resource/http_mock.rb index 22f83ae910..554fc3bcfc 100644 --- a/activeresource/lib/active_resource/http_mock.rb +++ b/activeresource/lib/active_resource/http_mock.rb @@ -65,7 +65,7 @@ module ActiveResource class << self # Returns an array of all request objects that have been sent to the mock. You can use this to check - # wether or not your model actually sent an HTTP request. + # if your model actually sent an HTTP request. # # ==== Example # def setup |