Class: Yt::Models::DetailsSet

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

Overview

Encapsulates information about the content of a resource, for instance a video.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ DetailsSet

Returns a new instance of DetailsSet.



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

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

Instance Method Details

#durationInteger

Returns the duration of the resource (in seconds).

Returns:

  • (Integer)

    the duration of the resource (in seconds).



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

def duration
  @duration = to_seconds @data.fetch('duration', 0)
end