Class: YouTubeIt::Request::UserSearch
- Inherits:
-
BaseSearch
- Object
- BaseSearch
- YouTubeIt::Request::UserSearch
- Includes:
- FieldSearch
- Defined in:
- lib/youtube_it/request/user_search.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#max_results ⇒ Object
readonly
max_results.
-
#offset ⇒ Object
readonly
start-index.
-
#order_by ⇒ Object
readonly
orderby, ([relevance], viewCount, published, rating).
Attributes inherited from BaseSearch
Instance Method Summary collapse
-
#initialize(params, options = {}) ⇒ UserSearch
constructor
A new instance of UserSearch.
Methods included from FieldSearch
#default_fields, #fields_to_params, #formatted_date
Constructor Details
#initialize(params, options = {}) ⇒ UserSearch
Returns a new instance of UserSearch.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/youtube_it/request/user_search.rb', line 9 def initialize(params, ={}) @max_results, @order_by, @offset = nil @url = base_url @dev_key = [:dev_key] if [:dev_key] if params == :favorites @url << "#{[:user]}/favorites" set_instance_variables() elsif params[:user] && [:favorites] @url << "#{params[:user]}/favorites" set_instance_variables(params) return elsif params[:user] @url << "#{params[:user]}/uploads" set_instance_variables(params) end @url << build_query_params(to_youtube_params) @url << fields_to_params(params.delete(:fields)) if params != :favorites && params[:fields] end |
Instance Attribute Details
#max_results ⇒ Object (readonly)
max_results
5 6 7 |
# File 'lib/youtube_it/request/user_search.rb', line 5 def max_results @max_results end |
#offset ⇒ Object (readonly)
start-index
7 8 9 |
# File 'lib/youtube_it/request/user_search.rb', line 7 def offset @offset end |
#order_by ⇒ Object (readonly)
orderby, ([relevance], viewCount, published, rating)
6 7 8 |
# File 'lib/youtube_it/request/user_search.rb', line 6 def order_by @order_by end |