Class: SearchApi::GoogleScholarOptions
- Inherits:
-
Object
- Object
- SearchApi::GoogleScholarOptions
- Includes:
- DynamicSchema::Definable, Helpers
- Defined in:
- lib/searchapi/google_scholar_options.rb
Constant Summary collapse
- SAFE_SEARCH =
%w[ active off ]- NORMALIZE_DOWNCASE =
->(v) { v.to_s.downcase }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}, api_options: nil) ⇒ GoogleScholarOptions
constructor
A new instance of GoogleScholarOptions.
- #to_h ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(options = {}, api_options: nil) ⇒ GoogleScholarOptions
36 37 38 39 |
# File 'lib/searchapi/google_scholar_options.rb', line 36 def initialize( = {}, api_options: nil ) = self.class.builder.build( || {} ) = .merge( ) if end |
Class Method Details
.build(options = nil, &block) ⇒ Object
28 29 30 |
# File 'lib/searchapi/google_scholar_options.rb', line 28 def self.build( = nil, &block ) new( api_options: builder.build( , &block ) ) end |
.build!(options = nil, &block) ⇒ Object
32 33 34 |
# File 'lib/searchapi/google_scholar_options.rb', line 32 def self.build!( = nil, &block ) new( api_options: builder.build!( , &block ) ) end |
Instance Method Details
#to_h ⇒ Object
41 42 43 44 45 |
# File 'lib/searchapi/google_scholar_options.rb', line 41 def to_h result = .to_h result[ :engine ] = 'google_scholar' result end |