Class: SearchApi::GoogleNewsLightOptions
- Inherits:
-
Object
- Object
- SearchApi::GoogleNewsLightOptions
- Includes:
- DynamicSchema::Definable, Helpers
- Defined in:
- lib/searchapi/google_news_light_options.rb
Constant Summary collapse
- TIME_PERIODS =
%w[ last_hour last_day last_week last_month last_year ]- SORT_BY =
%w[ most_recent ]- 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) ⇒ GoogleNewsLightOptions
constructor
A new instance of GoogleNewsLightOptions.
- #to_h ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(options = {}, api_options: nil) ⇒ GoogleNewsLightOptions
Returns a new instance of GoogleNewsLightOptions.
35 36 37 38 |
# File 'lib/searchapi/google_news_light_options.rb', line 35 def initialize( = {}, api_options: nil ) = self.class.builder.build( || {} ) = .merge( ) if end |
Class Method Details
.build(options = nil, &block) ⇒ Object
27 28 29 |
# File 'lib/searchapi/google_news_light_options.rb', line 27 def self.build( = nil, &block ) new( api_options: builder.build( , &block ) ) end |
.build!(options = nil, &block) ⇒ Object
31 32 33 |
# File 'lib/searchapi/google_news_light_options.rb', line 31 def self.build!( = nil, &block ) new( api_options: builder.build!( , &block ) ) end |
Instance Method Details
#to_h ⇒ Object
40 41 42 43 44 |
# File 'lib/searchapi/google_news_light_options.rb', line 40 def to_h result = .to_h result[ :engine ] = 'google_news_light' result end |