Skip to content

Commit

Permalink
Merge pull request #98 from cruessler/correct-typo
Browse files Browse the repository at this point in the history
correct a typo
  • Loading branch information
inukshuk committed Nov 10, 2014
2 parents 5833277 + 6ec752c commit 7c50ac2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/bibtex/error.rb
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
module BibTeX

class BibTeXError < StandardError
attr_reader :orginal
class BibTeXError < StandardError
attr_reader :original

def initialize(message = nil, original = $!)
super(message)
@original = original
end
end

class ParseError < BibTeXError; end
class ArgumentError < BibTeXError; end

#
# Represents a lexical or syntactical error.
#
class Error < Element

attr_reader :trace

def initialize(trace=[])
@trace = trace
end

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

def content
@trace.map { |e| e[1] }.join
end

# Called when the element was added to a bibliography.
def added_to_bibliography(bibliography)
super(bibliography)
bibliography.errors << self
self
end

# Called when the element was removed from a bibliography.
def removed_from_bibliography(bibliography)
super(bibliography)
bibliography.errors.delete(self)
self
end
end
end
end

0 comments on commit 7c50ac2

Please sign in to comment.