Class: Yt::Resource

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

Direct Known Subclasses

Channel, Playlist, Video

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Associations

#has_many

Methods included from Actions::Update

#do_update, #update_params

Constructor Details

#initialize(options = {}) ⇒ Resource

Returns a new instance of Resource.



9
10
11
12
13
14
# File 'lib/yt/models/resource.rb', line 9

def initialize(options = {})
  @id = options[:id]
  @auth = options[:auth]
  @snippet = Snippet.new(data: options[:snippet]) if options[:snippet]
  @status = Status.new(data: options[:status]) if options[:status]
end

Instance Attribute Details

#authObject (readonly)

Returns the value of attribute auth.



5
6
7
# File 'lib/yt/models/resource.rb', line 5

def auth
  @auth
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/yt/models/resource.rb', line 5

def id
  @id
end