class Tubeclip::Response::VideoSearch
Attributes
feed_id[R]
- String
-
Unique feed identifying url.
max_result_count[R]
- Fixnum
-
Number of results per page.
offset[R]
- Fixnum
-
1-based offset index into the full result set.
total_result_count[R]
- Fixnum
-
Total number of results available for the original request.
updated_at[R]
- Time
-
Date and time at which the feed was last updated
videos[R]
- Array
-
Array of
Tubeclip::Model::Video
records
Public Instance Methods
current_page()
click to toggle source
# File lib/tubeclip/response/video_search.rb, line 22 def current_page ((offset - 1) / max_result_count) + 1 end
next_page()
click to toggle source
current_page
+ 1 or nil if there is no next page
# File lib/tubeclip/response/video_search.rb, line 27 def next_page current_page < total_pages ? (current_page + 1) : nil end
previous_page()
click to toggle source
current_page
- 1 or nil if there is no previous page
# File lib/tubeclip/response/video_search.rb, line 32 def previous_page current_page > 1 ? (current_page - 1) : nil end
total_pages()
click to toggle source
# File lib/tubeclip/response/video_search.rb, line 36 def total_pages (total_result_count / max_result_count.to_f).ceil end