def field_names(filter = [], include_inherited = true)
      names = fields.keys

      if include_inherited && has_parent?
        names.concat(inherited_fields)
      end

      unless filter.empty?
        names = names & filter.map(&:to_sym)
      end

      names.sort!
      names
    end
def field_names(filter = [], include_inherited = true)
      names = fields.keys

      if include_inherited && has_parent?
        names.concat(inherited_fields)
      end

      unless filter.empty?
        names = names & filter.map(&:to_sym)
      end

      names.sort!
      names
    end
Returns a sorted list of the Entry's field names. If a +filter+ is passed
 as argument, returns all field names that are also defined by the filter.
 If the +filter+ is empty, returns all field names.

 If the second optional argument is true (default) and the Entry contains
 a cross-reference, the list will include all inherited fields.