Class: Google::Search::Patent

Inherits:
Google::Search show all
Includes:
OrderBy
Defined in:
lib/google-search/search/patent.rb

Constant Summary

Constants included from OrderBy

OrderBy::ORDER_BY

Constants inherited from Google::Search

URI, VERSION

Instance Attribute Summary collapse

Attributes included from OrderBy

#order_by

Attributes inherited from Google::Search

#api_key, #language, #offset, #options, #query, #sent, #size, #type, #version

Instance Method Summary collapse

Methods inherited from Google::Search

#all_items, #each_item, #each_response, #get_hash, #get_raw, #get_response, #get_uri, json_decode, #next, size_for, url_encode, #validate

Constructor Details

#initialize(options = {}, &block) ⇒ Patent

:nodoc:



22
23
24
25
# File 'lib/google-search/search/patent.rb', line 22

def initialize options = {}, &block
  @issued_only = options.delete :issued_only
  super
end

Instance Attribute Details

#issued_onlyObject

When nil all parents are returned. When true only issued will be returned, otherwise when false only filed but NOT issued patents will be returned.



18
19
20
# File 'lib/google-search/search/patent.rb', line 18

def issued_only
  @issued_only
end

Instance Method Details

#get_uri_paramsObject

:nodoc:



29
30
31
32
33
34
# File 'lib/google-search/search/patent.rb', line 29

def get_uri_params
  super + [
    [:as_psrg, issued_only ? 1 : nil],
    [:as_psra, issued_only === false ? 1 : nil]
    ]
end