Class: BOTR::VideoEngagement
- Defined in:
- lib/botr/videos/video_engagement.rb
Overview
The BOTR::VideoEngagement class contains calls for for displaying video engagement data.
Engagement analytics allow you to track which sections of a video are being watched by users. These analytics are useful for determining:
Drop off rates: Many users might drop off at a certain point in the video. Editing that section might increase engagement. Replay rates: Many users might replay a certain section in the video. This might be a location to target ads against.
Class Attribute Summary collapse
-
.last_status ⇒ Object
readonly
Returns the value of attribute last_status.
Instance Attribute Summary collapse
-
#engagements ⇒ Object
readonly
Returns the value of attribute engagements.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#last_status ⇒ Object
readonly
Returns the value of attribute last_status.
Class Method Summary collapse
- .call_class ⇒ Object
-
.show(video_key) ⇒ BOTR::VideoEngagement
(also: find)
engagement analytics for.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ VideoEngagement
constructor
A new instance of VideoEngagement.
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 = {}) ⇒ VideoEngagement
Returns a new instance of VideoEngagement.
58 59 60 61 62 63 64 |
# File 'lib/botr/videos/video_engagement.rb', line 58 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.
17 18 19 |
# File 'lib/botr/videos/video_engagement.rb', line 17 def last_status @last_status end |
Instance Attribute Details
#engagements ⇒ Object (readonly)
Returns the value of attribute engagements.
56 57 58 |
# File 'lib/botr/videos/video_engagement.rb', line 56 def engagements @engagements end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
56 57 58 |
# File 'lib/botr/videos/video_engagement.rb', line 56 def key @key end |
#last_status ⇒ Object (readonly)
Returns the value of attribute last_status.
56 57 58 |
# File 'lib/botr/videos/video_engagement.rb', line 56 def last_status @last_status end |
Class Method Details
.call_class ⇒ Object
19 20 21 |
# File 'lib/botr/videos/video_engagement.rb', line 19 def call_class "videos/engagement" end |
.show(video_key) ⇒ BOTR::VideoEngagement Also known as: find
engagement analytics for
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/botr/videos/video_engagement.rb', line 30 def show(video_key) json = get_request({: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 |