class BibTeX::Names

This class represents a list of names. This is the same class as BibTeX::Names from bibtex-ruby. See those class docs for more information.

Public Instance Methods

pretty(options={}) click to toggle source

Returns a string containing the list of names in first-last order, correctly delimited by commas and and

# File lib/bibout/bibtex.rb, line 97
def pretty(options={})
  names = map { |n| n.display_order(options) }
  return to_s if names.nil? or names.length < 1
  return names[0].to_s if names.length == 1
  names[0..-2].join(", ") + " and " + names[-1]
end