Class: SearchApi::GoogleFinanceOptions
- Inherits:
-
Object
- Object
- SearchApi::GoogleFinanceOptions
- Includes:
- DynamicSchema::Definable, Helpers
- Defined in:
- lib/searchapi/google_finance_options.rb
Constant Summary collapse
- WINDOWS =
%w[ 1D 5D 1M 6M YTD 1Y 5Y MAX ]- NORMALIZE_UPCASE =
->(v) { v.to_s.upcase }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}, api_options: nil) ⇒ GoogleFinanceOptions
constructor
A new instance of GoogleFinanceOptions.
- #to_h ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(options = {}, api_options: nil) ⇒ GoogleFinanceOptions
Returns a new instance of GoogleFinanceOptions.
28 29 30 31 |
# File 'lib/searchapi/google_finance_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_finance_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_finance_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_finance_options.rb', line 33 def to_h result = .to_h result[ :engine ] = 'google_finance' result end |