method
find_one
v2.2.1 -
Show latest stable
- Class:
ActiveResource::Base
find_one(options)private
Find a single resource from a one-off URL
# File activeresource/lib/active_resource/base.rb, line 580
def find_one(options)
case from = options[:from]
when Symbol
instantiate_record(get(from, options[:params]))
when String
path = "#{from}#{query_string(options[:params])}"
instantiate_record(connection.get(path, headers))
end
end Related methods
- Instance methods
- ==
- clone
- destroy
- dup
- encode
- eql?
- exists?
- hash
- id
- id=
- load
- new?
- reload
- respond_to?
- save
- to_json
- to_param
- to_xml
- Class methods
- collection_path
- connection
- create
- delete
- element_path
- exists?
- find
- format
- format=
- headers
- new
- password
- password=
- prefix
- prefix=
- prefix_source
- site
- site=
- timeout
- timeout=
- user
- user=
- Protected methods
-
collection_path -
connection -
create -
element_path -
id_from_response -
load_attributes_from_response -
update - Private methods
-
create_site_uri_from -
find_every -
find_one -
find_single -
instantiate_collection -
instantiate_record -
prefix_parameters -
query_string -
split_options -
find_or_create_resource_for -
find_or_create_resource_for_collection -
find_resource_in_modules -
method_missing -
split_options