Class: Rea::DBLP::Search

Inherits:
Object
  • Object
show all
Includes:
Rea::DBLP
Defined in:
lib/rea-dblp/rea/dblp/search.rb

Instance Method Summary collapse

Methods included from Rea::DBLP

grab, search, shortcut, url

Methods included from ErrorUtils

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

Instance Method Details

#call(query) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/rea-dblp/rea/dblp/search.rb', line 6

def call(query)
  unless query.size == 1 and query[:title]
    not_implemented_error!("Unable to search with #{query.inspect}")
  end
  title  = query[:title].gsub(/\s+/, "%20")
  xml    = get("#{search_url}?q=#{title}")
  tuples = QueryResultParser.parse(xml)
  Relation(tuples)
end