Method: MdnQuery.list

Defined in:
lib/mdn_query.rb

.list(query, options = {}) ⇒ MdnQuery::List

Searches the given query and creates a list with the results.

Parameters:

  • query (String)

    the query to search for

  • options (Hash) (defaults to: {})

    additional query options (see MdnQuery::Search#initialize)

Returns:

Raises:



31
32
33
34
35
36
37
38
# File 'lib/mdn_query.rb', line 31

def self.list(query, options = {})
  search = MdnQuery::Search.new(query, options)
  list = search.execute.to_list
  if list.empty?
    raise MdnQuery::NoEntryFound.new(query, options), 'No entry found'
  end
  list
end