fetch

fetch( header )fetch( header ) { |row| ... }fetch( header, default ) Instance Public methods This method will fetch the field value by header. It has the same behavior as Hash#fetch: if there is a field with the given header, its value is returned. Otherwise, if a block is given, it is yielded the header and its result is returned; if a default is given as the second argument, it is returned; otherwise a KeyError is raised.

field

field( header )field( header, offset )field( index ) Instance Public methods This method will return the field value by header or index. If a field is not found, nil is returned. When provided, offset ensures that a header match occurrs on or later than the offset index. You can use this to find duplicate headers, without resorting to hard-coding exact indices. []

field?

field?(data) Instance Public methods Returns true if data matches a field in this row, and false otherwise.

field_row?

field_row?() Instance Public methods Returns true if this is a field row.

fields

fields(*headers_and_or_indices) Instance Public methods This method accepts any number of arguments which can be headers, indices, Ranges of either, or two-element Arrays containing a header and offset. Each argument will be replaced with a field lookup as described in #field. If called with no arguments, all fields are returned. values_at

has_key?

has_key?(header) Instance Public methods Returns true if there is a field with the given header. include? key? member?

header?

header?(name) Instance Public methods Returns true if name is a header for this row, and false otherwise.

header_row?

header_row?() Instance Public methods Returns true if this is a header row.

headers

headers() Instance Public methods Returns the headers of this row.

include?

include?(header) Instance Public methods Alias for: has_key?