class BibTeX::Error

Represents a lexical or syntactical error.

Attributes

trace[R]

Public Class Methods

new(trace=[]) click to toggle source
# File lib/bibtex/error.rb, line 22
def initialize(trace=[])
  @trace = trace
end

Public Instance Methods

added_to_bibliography(bibliography) click to toggle source

Called when the element was added to a bibliography.

Calls superclass method BibTeX::Element#added_to_bibliography
# File lib/bibtex/error.rb, line 36
def added_to_bibliography(bibliography)
  super(bibliography)
  bibliography.errors << self
  self
end
content() click to toggle source
# File lib/bibtex/error.rb, line 31
def content
  @trace.map { |e| e[1] }.join
end
removed_from_bibliography(bibliography) click to toggle source

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
trace=(trace) click to toggle source
# 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