Class: YouTubeG::Request::VideoSearch
- Inherits:
-
BaseSearch
- Object
- BaseSearch
- YouTubeG::Request::VideoSearch
- Defined in:
- lib/youtube_g/request/video_search.rb
Overview
:nodoc:
Constant Summary collapse
- ONLY_EMBEDDABLE =
5
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#categories ⇒ Object
readonly
/-/Category1/Category2.
-
#max_results ⇒ Object
readonly
max_results.
-
#offset ⇒ Object
readonly
start-index.
-
#order_by ⇒ Object
readonly
orderby, ([relevance], viewCount, published, rating).
-
#query ⇒ Object
readonly
vq.
-
#racy ⇒ Object
readonly
racy ([exclude], include).
-
#response_format ⇒ Object
readonly
alt, ([atom], rss, json).
-
#tags ⇒ Object
readonly
/-/tag1/tag2.
-
#video_format ⇒ Object
readonly
format (1=mobile devices).
Attributes inherited from BaseSearch
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ VideoSearch
constructor
A new instance of VideoSearch.
Constructor Details
#initialize(params = {}) ⇒ VideoSearch
Returns a new instance of VideoSearch.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/youtube_g/request/video_search.rb', line 18 def initialize(params={}) # Initialize our various member data to avoid warnings and so we'll # automatically fall back to the youtube api defaults @max_results, @order_by, @offset, @query, @response_format, @video_format, @racy, @author = nil @url = base_url # Return a single video (base_url + /T7YazwP8GtY) return @url << "/" << params[:video_id] if params[:video_id] @url << "/-/" if (params[:categories] || params[:tags]) @url << categories_to_params(params.delete(:categories)) if params[:categories] @url << (params.delete(:tags)) if params[:tags] set_instance_variables(params) if( params[ :only_embeddable ] ) @video_format = ONLY_EMBEDDABLE end @url << build_query_params(to_youtube_params) end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
16 17 18 |
# File 'lib/youtube_g/request/video_search.rb', line 16 def @author end |
#categories ⇒ Object (readonly)
/-/Category1/Category2
13 14 15 |
# File 'lib/youtube_g/request/video_search.rb', line 13 def categories @categories end |
#max_results ⇒ Object (readonly)
max_results
7 8 9 |
# File 'lib/youtube_g/request/video_search.rb', line 7 def max_results @max_results end |
#offset ⇒ Object (readonly)
start-index
9 10 11 |
# File 'lib/youtube_g/request/video_search.rb', line 9 def offset @offset end |
#order_by ⇒ Object (readonly)
orderby, ([relevance], viewCount, published, rating)
8 9 10 |
# File 'lib/youtube_g/request/video_search.rb', line 8 def order_by @order_by end |
#query ⇒ Object (readonly)
vq
10 11 12 |
# File 'lib/youtube_g/request/video_search.rb', line 10 def query @query end |
#racy ⇒ Object (readonly)
racy ([exclude], include)
15 16 17 |
# File 'lib/youtube_g/request/video_search.rb', line 15 def racy @racy end |
#response_format ⇒ Object (readonly)
alt, ([atom], rss, json)
11 12 13 |
# File 'lib/youtube_g/request/video_search.rb', line 11 def response_format @response_format end |
#tags ⇒ Object (readonly)
/-/tag1/tag2
12 13 14 |
# File 'lib/youtube_g/request/video_search.rb', line 12 def @tags end |
#video_format ⇒ Object (readonly)
format (1=mobile devices)
14 15 16 |
# File 'lib/youtube_g/request/video_search.rb', line 14 def video_format @video_format end |