inspect()
public
Returns a simplified description of the key CSV
attributes in an ASCII compatible String.
Show source
def inspect
str = ["<#", self.class.to_s, " io_type:"]
if @io == $stdout then str << "$stdout"
elsif @io == $stdin then str << "$stdin"
elsif @io == $stderr then str << "$stderr"
else str << @io.class.to_s
end
if @io.respond_to?(:path) and (p = @io.path)
str << " io_path:" << p.inspect
end
str << " encoding:" << @encoding.name
] lineno col_sep row_sep
quote_char skip_blanks ].each do |attr_name|
if a = instance_variable_get("@#{attr_name}")
str << " " << attr_name << ":" << a.inspect
end
end
if @use_headers
str << " headers:" << headers.inspect
end
str << ">"
begin
str.join('')
rescue
str.map do |s|
e = Encoding::Converter.asciicompat_encoding(s.encoding)
e ? s.encode(e) : s.force_encoding("ASCII-8BIT")
end.join('')
end
end