Class: Yt::Models::ContentDetail

Inherits:
Base
  • Object
show all
Defined in:
lib/yt/models/content_detail.rb

Overview

Encapsulates information about the video content, including the length of the video and an indication of whether captions are available.

Instance Method Summary collapse

Methods included from Associations::HasReports

#has_report

Methods included from Associations::HasViewerPercentages

#has_viewer_percentages

Methods included from Associations::HasOne

#has_one

Methods included from Associations::HasMany

#has_many

Methods included from Associations::HasAuthentication

#has_authentication

Constructor Details

#initialize(options = {}) ⇒ ContentDetail



10
11
12
# File 'lib/yt/models/content_detail.rb', line 10

def initialize(options = {})
  @data = options[:data]
end

Instance Method Details

#captioned?Boolean



30
31
32
# File 'lib/yt/models/content_detail.rb', line 30

has_attribute :captioned?, from: :caption do |caption|
  caption == 'true'
end

#durationInteger



15
16
17
# File 'lib/yt/models/content_detail.rb', line 15

has_attribute :duration, default: 0 do |value|
  to_seconds value
end

#hd?Boolean



25
26
27
# File 'lib/yt/models/content_detail.rb', line 25

has_attribute :hd?, from: :definition do |definition|
  definition == 'hd'
end

#licensed?Boolean



36
# File 'lib/yt/models/content_detail.rb', line 36

has_attribute :licensed?, default: false, from: :licensed_content

#stereoscopic?Boolean



20
21
22
# File 'lib/yt/models/content_detail.rb', line 20

has_attribute :stereoscopic?, from: :dimension do |dimension|
  dimension == '3d'
end