clbustos/Rserve-Ruby-client — pull request #12 by nessche (2012-11-02 19:10:43+00:00)
Title: No method exception when converting a "named Float" to ruby

When R returns an array of only one element the first internal convertsion (to class in the REXP module) strips away the array information and converts it directly into an instance of a subclass of `Numeric`. The problem arises when the array is also named because the module `WithNames` expects an Array and not a `Numeric`.
The current implementation was only checking for subclasses of `Fixnum`, replacing `Fixnum`with `Numeric`fixes the bug, but discards the name information. This is what this patch does, but it is only a band-aid that stops the exception, but does not cure the actual reason.

A more complete solution would be to also preserve the information, this could be achieved in two ways
* change the code such that an object with attribute `names` must always be a "complex" object, thus returning an array of one element, if need be
* add another module called `WithName` (singular) that adds a name instance variable to an object, and change the `to_ruby` method to extend `Numeric` objects with it, if need be.

The first approach is in my belief the cleanest as it is closer to the actual representation, but it may not be backward compatible
The second approach is a bit more hackish, but is backward compatible.

So I let it up to you to decide which method fits best with your idea of the library.