Represents a lexical or syntactical error.
# File lib/bibtex/error.rb, line 22 def initialize(trace=[]) @trace = trace end
Called when the element was added to a bibliography.
# File lib/bibtex/error.rb, line 36 def added_to_bibliography(bibliography) super(bibliography) bibliography.errors << self self end
# File lib/bibtex/error.rb, line 31 def content @trace.map { |e| e[1] }.join end
Called when the element was removed from a bibliography.
# File lib/bibtex/error.rb, line 43 def removed_from_bibliography(bibliography) super(bibliography) bibliography.errors.delete(self) self end
# File lib/bibtex/error.rb, line 26 def trace=(trace) raise(ArgumentError, "BibTeX::Error trace must be of type Array; was: #{trace.class.name}.") unless trace.kind_of?(Array) @trace = trace end