Class: BOTR::VideoView
Overview
The BOTR::VideoView class contains calls for requesting video views statistics.
A video view is counted every time:
The video starts playing in one of your players. The video starts downloading from our content server. When a user scrubs through the video in a player or restarts the video, no additional view is counted.
Class Attribute Summary collapse
-
.last_status ⇒ Object
readonly
Returns the value of attribute last_status.
Instance Attribute Summary collapse
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#days ⇒ Object
readonly
Returns the value of attribute days.
-
#downloads ⇒ Object
readonly
Returns the value of attribute downloads.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#last_status ⇒ Object
readonly
Returns the value of attribute last_status.
-
#months ⇒ Object
readonly
Returns the value of attribute months.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#pageviews ⇒ Object
readonly
Returns the value of attribute pageviews.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#streams ⇒ Object
readonly
Returns the value of attribute streams.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
-
#viewed ⇒ Object
readonly
Returns the value of attribute viewed.
-
#views ⇒ Object
readonly
Returns the value of attribute views.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Class Method Summary collapse
- .all ⇒ Object
-
.list(**options) ⇒ Array
A list of objects with the statistics of the all videos matching the search criteria.
-
.show(video_key, **options) ⇒ BOTR::VideoView
(also: find)
A new object with the statistics for the video referenced by the video_key.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ VideoView
constructor
A new instance of VideoView.
Methods included from Authentication
Methods included from API
#api_call_class, #api_format, #api_key, #api_nonce, #api_protocol, #api_secret_key, #api_server, #api_timestamp, #api_url, #api_version, #progress_url, #upload_address, #upload_key, #upload_protocol, #upload_token, #upload_url
Methods included from HTTP
#client, #delete_request, #get_request, #post_request, #put_request
Constructor Details
#initialize(params = {}) ⇒ VideoView
Returns a new instance of VideoView.
140 141 142 143 144 145 146 |
# File 'lib/botr/videos/video_view.rb', line 140 def initialize(params = {}) params.each do |key, val| param = "@#{key.to_s}" next unless methods.include? key.to_sym instance_variable_set(param, val) end end |
Class Attribute Details
.last_status ⇒ Object (readonly)
Returns the value of attribute last_status.
16 17 18 |
# File 'lib/botr/videos/video_view.rb', line 16 def last_status @last_status end |
Instance Attribute Details
#date ⇒ Object (readonly)
Returns the value of attribute date.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def date @date end |
#days ⇒ Object (readonly)
Returns the value of attribute days.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def days @days end |
#downloads ⇒ Object (readonly)
Returns the value of attribute downloads.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def downloads @downloads end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def key @key end |
#last_status ⇒ Object (readonly)
Returns the value of attribute last_status.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def last_status @last_status end |
#months ⇒ Object (readonly)
Returns the value of attribute months.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def months @months end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def number @number end |
#pageviews ⇒ Object (readonly)
Returns the value of attribute pageviews.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def pageviews @pageviews end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def status @status end |
#streams ⇒ Object (readonly)
Returns the value of attribute streams.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def streams @streams end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def title @title end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def total @total end |
#viewed ⇒ Object (readonly)
Returns the value of attribute viewed.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def viewed @viewed end |
#views ⇒ Object (readonly)
Returns the value of attribute views.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def views @views end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
136 137 138 |
# File 'lib/botr/videos/video_view.rb', line 136 def year @year end |
Class Method Details
.all ⇒ Object
99 100 101 |
# File 'lib/botr/videos/video_view.rb', line 99 def all list({}) end |
.list(**options) ⇒ Array
Returns a list of objects with the statistics of the all videos matching the search criteria.
86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/botr/videos/video_view.rb', line 86 def list(**) json = get_request(.merge(:method => 'list')) res = JSON.parse(json.body) if json.status == 200 results = process_list_response(res) else raise "HTTP Error #{json.status}: #{json.body}" end return results end |
.show(video_key, **options) ⇒ BOTR::VideoView Also known as: find
Returns a new object with the statistics for the video referenced by the video_key.
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/botr/videos/video_view.rb', line 38 def show(video_key, **) json = get_request(.merge(:method => 'show', :video_key => video_key)) res = JSON.parse(json.body) if json.status == 200 params = process_show_response(res) else raise "HTTP Error #{json.status}: #{json.body}" end return new(params) end |