Class: Rea::DBLP::Parser

Inherits:
Object
  • Object
show all
Includes:
ErrorUtils
Defined in:
lib/rea-dblp/rea/dblp/parser.rb

Direct Known Subclasses

EntryParser, QueryResultParser

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ErrorUtils

#error_message, #not_found_error!, #not_implemented_error!, #parse_error!, #parse_format_error!, #third_party_error!, #unexpected_error!

Class Method Details

.parse(*args, &bl) ⇒ Object



6
7
8
# File 'lib/rea-dblp/rea/dblp/parser.rb', line 6

def self.parse(*args, &bl)
  new.parse(*args, &bl)
end

Instance Method Details

#parse(path) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/rea-dblp/rea/dblp/parser.rb', line 10

def parse(path)
  if path.respond_to?(:to_path)
    parse_text(Path(path).read, path)
  else
    parse_text(path, nil)
  end
end