Class: SearchApi::GoogleLocalOptions
- Inherits:
-
Object
- Object
- SearchApi::GoogleLocalOptions
- Includes:
- DynamicSchema::Definable, Helpers
- Defined in:
- lib/searchapi/google_local_options.rb
Constant Summary collapse
- DEVICES =
%w[ desktop mobile tablet ]- NORMALIZE_DOWNCASE =
->(v) { v.to_s.downcase }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}, api_options: nil) ⇒ GoogleLocalOptions
constructor
A new instance of GoogleLocalOptions.
- #to_h ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(options = {}, api_options: nil) ⇒ GoogleLocalOptions
Returns a new instance of GoogleLocalOptions.
28 29 30 31 |
# File 'lib/searchapi/google_local_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_local_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_local_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_local_options.rb', line 33 def to_h result = .to_h result[ :engine ] = 'google_local' result end |