Class: YouTubeG::Request::UserSearch

Inherits:
BaseSearch show all
Defined in:
lib/youtube_g/request/user_search.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from BaseSearch

#url

Instance Method Summary collapse

Constructor Details

#initialize(params, options = {}) ⇒ UserSearch

Returns a new instance of UserSearch.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/youtube_g/request/user_search.rb', line 8

def initialize(params, options={})
  @max_results, @order_by, @offset = nil
  @url = base_url

  if params == :favorites
    @url << "#{options[:user]}/favorites" 
    set_instance_variables(options)
  elsif params[:user] && options[: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)
end

Instance Attribute Details

#max_resultsObject (readonly)

max_results



4
5
6
# File 'lib/youtube_g/request/user_search.rb', line 4

def max_results
  @max_results
end

#offsetObject (readonly)

start-index



6
7
8
# File 'lib/youtube_g/request/user_search.rb', line 6

def offset
  @offset
end

#order_byObject (readonly)

orderby, ([relevance], viewCount, published, rating)



5
6
7
# File 'lib/youtube_g/request/user_search.rb', line 5

def order_by
  @order_by
end