Class: RPCMapper::Adapters::RestfulHTTPAdapter
- Inherits:
-
AbstractAdapter
- Object
- AbstractAdapter
- RPCMapper::Adapters::RestfulHTTPAdapter
- Defined in:
- lib/rpc_mapper/adapters/restful_http_adapter.rb
Instance Attribute Summary collapse
-
#last_response ⇒ Object
readonly
Returns the value of attribute last_response.
Attributes inherited from AbstractAdapter
Instance Method Summary collapse
- #delete(object) ⇒ Object
-
#initialize(*args) ⇒ RestfulHTTPAdapter
constructor
A new instance of RestfulHTTPAdapter.
- #write(object) ⇒ Object
Methods inherited from AbstractAdapter
create, #extend_adapter, #read, register_as
Methods included from Logger
Constructor Details
#initialize(*args) ⇒ RestfulHTTPAdapter
Returns a new instance of RestfulHTTPAdapter.
10 11 12 13 |
# File 'lib/rpc_mapper/adapters/restful_http_adapter.rb', line 10 def initialize(*args) super @configuration_contexts << { :primary_key => :id } end |
Instance Attribute Details
#last_response ⇒ Object (readonly)
Returns the value of attribute last_response.
8 9 10 |
# File 'lib/rpc_mapper/adapters/restful_http_adapter.rb', line 8 def last_response @last_response end |
Instance Method Details
#delete(object) ⇒ Object
20 21 22 |
# File 'lib/rpc_mapper/adapters/restful_http_adapter.rb', line 20 def delete(object) delete_http(object) end |
#write(object) ⇒ Object
15 16 17 18 |
# File 'lib/rpc_mapper/adapters/restful_http_adapter.rb', line 15 def write(object) params = build_params_from_attributes(object) object.new_record? ? post_http(object, params) : put_http(object, params) end |