Class: Yt::Models::LiveStreamingDetail
- Defined in:
- lib/yt/models/live_streaming_detail.rb
Overview
Encapsulates information about a live video broadcast. The object will only be present in a video resource if the video is an upcoming, live, or completed live broadcast.
Instance Method Summary collapse
- #actual_end_time ⇒ Time?
- #actual_start_time ⇒ Time?
- #concurrent_viewers ⇒ Integer?
-
#initialize(options = {}) ⇒ LiveStreamingDetail
constructor
A new instance of LiveStreamingDetail.
- #scheduled_end_time ⇒ Time?
-
#scheduled_start_time ⇒ Time
The time that the broadcast is scheduled to begin.
Methods included from Associations::HasReports
Methods included from Associations::HasViewerPercentages
Methods included from Associations::HasOne
Methods included from Associations::HasMany
Methods included from Associations::HasAuthentication
Constructor Details
#initialize(options = {}) ⇒ LiveStreamingDetail
Returns a new instance of LiveStreamingDetail.
11 12 13 |
# File 'lib/yt/models/live_streaming_detail.rb', line 11 def initialize( = {}) @data = [:data] || {} end |
Instance Method Details
#actual_end_time ⇒ Time?
27 28 29 30 31 |
# File 'lib/yt/models/live_streaming_detail.rb', line 27 def actual_end_time @actual_end_time ||= if @data['actualEndTime'] Time.parse @data['actualEndTime'] end end |
#actual_start_time ⇒ Time?
18 19 20 21 22 |
# File 'lib/yt/models/live_streaming_detail.rb', line 18 def actual_start_time @actual_start_time ||= if @data['actualStartTime'] Time.parse @data['actualStartTime'] end end |
#concurrent_viewers ⇒ Integer?
54 55 56 57 58 |
# File 'lib/yt/models/live_streaming_detail.rb', line 54 def concurrent_viewers @concurrent_viewers ||= if @data['concurrentViewers'] @data['concurrentViewers'].to_i end end |
#scheduled_end_time ⇒ Time?
43 44 45 46 47 |
# File 'lib/yt/models/live_streaming_detail.rb', line 43 def scheduled_end_time @scheduled_end_time ||= if @data['scheduledEndTime'] Time.parse @data['scheduledEndTime'] end end |
#scheduled_start_time ⇒ Time
Returns the time that the broadcast is scheduled to begin.
34 35 36 37 38 |
# File 'lib/yt/models/live_streaming_detail.rb', line 34 def scheduled_start_time @scheduled_start_time ||= if @data['scheduledStartTime'] Time.parse @data['scheduledStartTime'] end end |