Class: YouTubeG::Request::CommentsSearch
- Inherits:
-
BaseSearch
- Object
- BaseSearch
- YouTubeG::Request::CommentsSearch
- Defined in:
- lib/youtube_g/request/comments_search.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#max_results ⇒ Object
readonly
max_results.
-
#offset ⇒ Object
readonly
start-index.
Attributes inherited from BaseSearch
Instance Method Summary collapse
-
#initialize(video_id, options = {}) ⇒ CommentsSearch
constructor
A new instance of CommentsSearch.
Constructor Details
#initialize(video_id, options = {}) ⇒ CommentsSearch
Returns a new instance of CommentsSearch.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/youtube_g/request/comments_search.rb', line 7 def initialize(video_id, ={}) @max_results, @order_by, @offset = nil @url = base_url @url << "videos/#{video_id}/comments" set_instance_variables() if .has_key?(:per_page) @max_results = [:per_page] end if .has_key?(:page) per_page = @max_results || 25 @offset = calculate_offset([:page], per_page) end @url << build_query_params(to_youtube_params) end |
Instance Attribute Details
#max_results ⇒ Object (readonly)
max_results
4 5 6 |
# File 'lib/youtube_g/request/comments_search.rb', line 4 def max_results @max_results end |
#offset ⇒ Object (readonly)
start-index
5 6 7 |
# File 'lib/youtube_g/request/comments_search.rb', line 5 def offset @offset end |