lib/rserve/rexp/genericvector.rb in rserve-client-0.1.5 vs lib/rserve/rexp/genericvector.rb in rserve-client-0.1.6

- old
+ new

@@ -1,17 +1,16 @@ module Rserve class REXP class GenericVector < REXP::Vector attr_reader :payload - def initialize(list,attr=nil) + def initialize(list, attr=nil) super(attr) @payload=list.nil? ? Rlist.new() : list - if (payload.named?) @attr = REXP::List.new( Rlist.new([REXP::String.new(payload.keys())], - ["names"])); + ["names"])); end end def length @payload.size end @@ -21,9 +20,12 @@ def recursive? true end def as_list @payload + end + def to_ruby + @payload.to_ruby end end end end