Rserve::REXP::String

Constants

NA

Attributes

payload[R]

Public Class Methods

new(data, attrs=nil) click to toggle source
# File lib/rserve/rexp/string.rb, line 6
def initialize(data, attrs=nil)
  @payload=case data
  when Array
    data.map {|v| v.to_s}
  else
    [data.to_s]
  end
  super(attrs)
end

Public Instance Methods

as_strings() click to toggle source
# File lib/rserve/rexp/string.rb, line 21
def as_strings
  @payload
end
length() click to toggle source
# File lib/rserve/rexp/string.rb, line 15
def length
  payload.length
end
na?(value=nil) click to toggle source
# File lib/rserve/rexp/string.rb, line 25
def na?(value=nil)
  if value.nil?
    @payload.map {|v| NA.include? v}
  else
    NA.include? value
  end
end
string?() click to toggle source
# File lib/rserve/rexp/string.rb, line 18
def string?
  true
end
to_debug_string() click to toggle source
# File lib/rserve/rexp/string.rb, line 32
def to_debug_string
  t=super
  t << "{"  << @payload.map(&:to_s).join(",") << "}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.