def fields(filter=nil)
      unless filter
        # Since we're returning the FieldMap object, which the caller
        # may mutate, we precautionarily mark dirty -- unless it's frozen
        # immutable.
        @fields.clean = false unless @fields.frozen?
        return @fields
      end
      @fields.reindex unless @fields.clean
      flds = []
      if filter.is_a?(String) && @fields.tags[filter]
        @fields.tags[filter].each do |idx|
          flds << @fields[idx]
        end
      elsif filter.is_a?(Array) || filter.is_a?(Range)
        @fields.each_by_tag(filter) do |tag|
          flds << tag
        end
      end
      flds
    end
def fields(filter=nil)
      unless filter
        # Since we're returning the FieldMap object, which the caller
        # may mutate, we precautionarily mark dirty -- unless it's frozen
        # immutable.
        @fields.clean = false unless @fields.frozen?
        return @fields
      end
      @fields.reindex unless @fields.clean
      flds = []
      if filter.is_a?(String) && @fields.tags[filter]
        @fields.tags[filter].each do |idx|
          flds << @fields[idx]
        end
      elsif filter.is_a?(Array) || filter.is_a?(Range)
        @fields.each_by_tag(filter) do |tag|
          flds << tag
        end
      end
      flds
    end
Provides a backwards compatible means to access the FieldMap.
 No argument returns the FieldMap array in entirety.  Providing
 a string, array or range of tags will return an array of fields
 in the order they appear in the record.