Class: Yt::Models::Resource

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

Direct Known Subclasses

Channel, Comment, CommentThread, Playlist, PlaylistItem, Video

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#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’.



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

delegate :privacy_status, to: :status

Instance Method Details

#private?Boolean

Returns whether the resource is private.

Returns:

  • (Boolean)

    whether the resource is private.



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

def private?
  privacy_status == 'private'
end

#public?Boolean

Returns whether the resource is public.

Returns:

  • (Boolean)

    whether the resource is public.



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

def public?
  privacy_status == 'public'
end

#unlisted?Boolean

Returns whether the resource is unlisted.

Returns:

  • (Boolean)

    whether the resource is unlisted.



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

def unlisted?
  privacy_status == 'unlisted'
end