liveh2o/active_remote — pull request #22 by liveh2o (2014-03-08 02:50:39+00:00)
Title: Rework serialization

In an effort to clean up some legacy code and pave the way to support different RPC adapters, this reworks serialization. The main changes are to move away from relying on `Base#last_response` being set by `Base#execute` and instead returning the response object. That means changing the serialization to accept arguments instead of accessing the last response attribute directly.

### Serialization

The `Search` and `Bulk` modules have been updated to capture the response and then pass the records to the new `Base.serialize_records` method.

Likewise, all of the persistence methods have been updated to capture the response instead of relying on the last response attribute

### RPC

To begin work on supporting different RPC adapters, a new `Base.rpc` method has been added to use when executing RPC calls. Currently, it simply initializes a new instance of the base class, but in the future it will hold an instance of the adapter.

// @localshred @nelsonwittwer @abrandoned