method
inspect
v2_6_3 -
Show latest stable
- Class:
CSV
inspect()public
# File lib/csv.rb, line 1279
def inspect
str = ["<#", self.class.to_s, " io_type:"]
# show type of wrapped IO
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
# show IO.path(), if available
if @io.respond_to?(:path) and (p = @io.path)
str << " io_path:" << p.inspect
end
# show encoding
str << " encoding:" << @encoding.name
# show other attributes
["lineno", "col_sep", "row_sep", "quote_char"].each do |attr_name|
if a = __send__(attr_name)
str << " " << attr_name << ":" << a.inspect
end
end
["skip_blanks", "liberal_parsing"].each do |attr_name|
if a = __send__("#{attr_name}?")
str << " " << attr_name << ":" << a.inspect
end
end
_headers = headers
str << " headers:" << _headers.inspect if _headers
str << ">"
begin
str.join('')
rescue # any encoding error
str.map do |s|
e = Encoding::Converter.asciicompat_encoding(s.encoding)
e ? s.encode(e) : s.force_encoding("ASCII-8BIT")
end.join('')
end
end Related methods
- Instance methods
- <<
- add_row
- binmode?
- col_sep
- convert
- converters
- each
- eof
- eof?
- field_size_limit
- flock
- force_quotes?
- gets
- header_convert
- header_converters
- header_row?
- headers
- inspect
- ioctl
- liberal_parsing?
- line
- lineno
- path
- puts
- quote_char
- read
- readline
- readlines
- return_headers?
- rewind
- row_sep
- shift
- skip_blanks?
- skip_lines
- stat
- to_i
- to_io
- unconverted_fields?
- write_headers?
- Class methods
- filter
- foreach
- generate
- generate_line
- instance
- new
- open
- parse
- parse_line
- read
- readlines
- table
- Private methods
-
build_fields_converter -
build_header_fields_converter -
build_parser_fields_converter -
build_writer_fields_converter -
convert_fields -
determine_encoding -
header_fields_converter -
normalize_converters -
parser -
parser_enumerator -
parser_fields_converter -
parser_options -
raw_encoding -
writer -
writer_fields_converter -
writer_options