Class: SearchApi::YouTubeSearchOptions
- Inherits:
-
Object
- Object
- SearchApi::YouTubeSearchOptions
- Includes:
- DynamicSchema::Definable, Helpers
- Defined in:
- lib/searchapi/youtube_search_options.rb
Constant Summary collapse
- COUNTRIES =
%w[ DZ AR AU AT AZ BH BD BY BE BO BA BR BG KH CA CL CO CR HR CY CZ DK DO EC EG SV EE FI FR GE DE GH GR GT HN HK HU IS IN ID IQ IE IL IT JM JP JO KZ KE KW LA LV LB LY LI LT LU MY MT MX ME MA NP NL NZ NI NG MK NO OM PK PA PG PY PE PH PL PT PR QA RO RU SA SN RS SG SK SI ZA KR ES LK SE CH TW TZ TH TN TR UG UA AE GB US UY VE VN YE ZW ]- LANGUAGES =
%w[ af az id ms bs ca cs da de et en-in en-gb en es es-419 es-us eu fil fr fr-ca gl hr zu is it sw lv lt hu nl no uz pl pt-pt pt ro sq sk sl sr-latn fi sv vi tr be bg ky kk mk mn ru sr uk el hy iw ur ar fa ne mr hi as bn pa gu or ta te kn ml si th lo my ka am km zh-cn zh-tw zh-hk ja ko ]- NORMALIZE_UPCASE =
->(v) { v.to_s.upcase }
- NORMALIZE_DOWNCASE =
->(v) { v.to_s.downcase }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}, api_options: nil) ⇒ YouTubeSearchOptions
constructor
A new instance of YouTubeSearchOptions.
- #to_h ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(options = {}, api_options: nil) ⇒ YouTubeSearchOptions
Returns a new instance of YouTubeSearchOptions.
50 51 52 53 |
# File 'lib/searchapi/youtube_search_options.rb', line 50 def initialize( = {}, api_options: nil ) = self.class.builder.build( || {} ) = .merge( ) if end |
Class Method Details
.build(options = nil, &block) ⇒ Object
42 43 44 |
# File 'lib/searchapi/youtube_search_options.rb', line 42 def self.build( = nil, &block ) new( api_options: builder.build( , &block ) ) end |
.build!(options = nil, &block) ⇒ Object
46 47 48 |
# File 'lib/searchapi/youtube_search_options.rb', line 46 def self.build!( = nil, &block ) new( api_options: builder.build!( , &block ) ) end |
Instance Method Details
#to_h ⇒ Object
55 56 57 58 59 |
# File 'lib/searchapi/youtube_search_options.rb', line 55 def to_h result = .to_h result[ :engine ] = 'youtube' result end |