method
site
rails latest stable - Class:
ActiveResource::Base
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.
site()public
Gets the URI of the REST resources to map for this class. The site variable is required for Active Resource’s mapping to work.
# File activeresource/lib/active_resource/base.rb, line 387
def site
# Not using superclass_delegating_reader because don't want subclasses to modify superclass instance
#
# With superclass_delegating_reader
#
# Parent.site = 'http://[email protected]'
# Subclass.site # => 'http://[email protected]'
# Subclass.site.user = 'david'
# Parent.site # => 'http://[email protected]'
#
# Without superclass_delegating_reader (expected behavior)
#
# Parent.site = 'http://[email protected]'
# Subclass.site # => 'http://[email protected]'
# Subclass.site.user = 'david' # => TypeError: can't modify frozen object
#
if defined?(@site)
@site
elsif superclass != Object && superclass.site
superclass.site.dup.freeze
end
end Related methods
- Instance methods
- ==
- clone
- destroy
- dup
- encode
- eql?
- exists?
- hash
- id
- id=
- known_attributes
- load
- new?
- new_record?
- persisted?
- reload
- respond_to?
- respond_to_without_attributes?
- save
- save!
- schema
- to_json
- to_xml
- update_attribute
- update_attributes
- Class methods
- all
- auth_type
- auth_type=
- build
- collection_name
- collection_path
- connection
- create
- delete
- element_name
- element_path
- exists?
- find
- first
- format
- format=
- headers
- known_attributes
- last
- logger
- new
- new_element_path
- password
- password=
- prefix
- prefix=
- prefix_source
- primary_key
- proxy
- proxy=
- schema
- schema=
- set_prefix
- site
- site=
- ssl_options
- ssl_options=
- timeout
- timeout=
- user
- user=
- Protected methods
-
collection_path -
connection -
create -
element_path -
id_from_response -
load_attributes_from_response -
new_element_path -
update - Private methods
-
check_prefix_options -
create_proxy_uri_from -
create_site_uri_from -
find_every -
find_one -
find_single -
instantiate_collection -
instantiate_record -
prefix_parameters -
query_string -
split_options -
create_resource_for -
find_or_create_resource_for -
find_or_create_resource_for_collection -
find_or_create_resource_in_modules -
method_missing -
read_attribute_for_serialization -
response_code_allows_body? -
split_options