Class: Yt::Models::Resource

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

Direct Known Subclasses

Channel, Playlist, PlaylistItem, Video

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idString (readonly)

Returns the ID that YouTube uses to identify each resource.

Returns:

  • (String)

    the ID that YouTube uses to identify each resource.



16
# File 'lib/yt/models/resource.rb', line 16

has_one :id

#privacy_statusString (readonly)

Returns the privacy status of the resource. Possible values are: ‘private’, ‘public’, ‘unlisted’.

Returns:

  • (String)

    the privacy status of the resource. Possible values are: ‘private’, ‘public’, ‘unlisted’.



25
# File 'lib/yt/models/resource.rb', line 25

delegate :privacy_status, to: :status

Instance Method Details

#private?Boolean

Returns whether the resource is private.

Returns:

  • (Boolean)

    whether the resource is private.



33
34
35
# File 'lib/yt/models/resource.rb', line 33

def private?
  privacy_status == 'private'
end

#public?Boolean

Returns whether the resource is public.

Returns:

  • (Boolean)

    whether the resource is public.



28
29
30
# File 'lib/yt/models/resource.rb', line 28

def public?
  privacy_status == 'public'
end

#unlisted?Boolean

Returns whether the resource is unlisted.

Returns:

  • (Boolean)

    whether the resource is unlisted.



38
39
40
# File 'lib/yt/models/resource.rb', line 38

def unlisted?
  privacy_status == 'unlisted'
end