Class: Plagiarism::URLSearch

Inherits:
Search
  • Object
show all
Defined in:
lib/plagiarism/url_search.rb

Instance Attribute Summary

Attributes inherited from Search

#request, #response

Instance Method Summary collapse

Methods inherited from Search

#count, #error?, #results?, #results_url, #success?, #words

Constructor Details

#initialize(search_url, options = {}) ⇒ URLSearch

Returns a new instance of URLSearch.



4
5
6
7
8
9
# File 'lib/plagiarism/url_search.rb', line 4

def initialize(search_url, options = {})
  validate_url(search_url)
  params = search_params(options).merge(q: search_url)
  @request = Request.new(:get, params)
  @response = @request.response
end