Class: SearchApi::GoogleNewsPortalOptions
- Inherits:
-
Object
- Object
- SearchApi::GoogleNewsPortalOptions
- Includes:
- DynamicSchema::Definable, Helpers
- Defined in:
- lib/searchapi/google_news_portal_options.rb
Constant Summary collapse
- SORT_BY =
%w[ relevance date ]- NORMALIZE_DOWNCASE =
->(v) { v.to_s.downcase }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}, api_options: nil) ⇒ GoogleNewsPortalOptions
constructor
A new instance of GoogleNewsPortalOptions.
- #to_h ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(options = {}, api_options: nil) ⇒ GoogleNewsPortalOptions
Returns a new instance of GoogleNewsPortalOptions.
28 29 30 31 |
# File 'lib/searchapi/google_news_portal_options.rb', line 28 def initialize( = {}, api_options: nil ) = self.class.builder.build( || {} ) = .merge( ) if end |
Class Method Details
.build(options = nil, &block) ⇒ Object
20 21 22 |
# File 'lib/searchapi/google_news_portal_options.rb', line 20 def self.build( = nil, &block ) new( api_options: builder.build( , &block ) ) end |
.build!(options = nil, &block) ⇒ Object
24 25 26 |
# File 'lib/searchapi/google_news_portal_options.rb', line 24 def self.build!( = nil, &block ) new( api_options: builder.build!( , &block ) ) end |
Instance Method Details
#to_h ⇒ Object
33 34 35 36 37 |
# File 'lib/searchapi/google_news_portal_options.rb', line 33 def to_h result = .to_h result[ :engine ] = 'google_news_portal' result end |