Class: Yt::Models::Status

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

Overview

Encapsulates information about the privacy status of a resource, for instance a channel.

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Status

Returns a new instance of Status.



7
8
9
# File 'lib/yt/models/status.rb', line 7

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

Instance Method Details

#privacy_statusString

Valid values are: private, public, unlisted

Returns:

  • (String)

    the privacy status of the channel.



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

def privacy_status
  @privacy_status ||= @data['privacyStatus']
end

#private?Boolean

Returns whether the resource is private.

Returns:

  • (Boolean)

    whether the resource is private



17
18
19
# File 'lib/yt/models/status.rb', line 17

def private?
  privacy_status == 'private'
end

#public?Boolean

Returns whether the resource is public.

Returns:

  • (Boolean)

    whether the resource is public



12
13
14
# File 'lib/yt/models/status.rb', line 12

def public?
  privacy_status == 'public'
end

#unlisted?Boolean

Returns whether the resource is unlisted.

Returns:

  • (Boolean)

    whether the resource is unlisted



22
23
24
# File 'lib/yt/models/status.rb', line 22

def unlisted?
  privacy_status == 'unlisted'
end