Class: Yt::PlaylistItem
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#video ⇒ Object
readonly
Returns the value of attribute video.
Instance Method Summary collapse
- #delete ⇒ Object
- #exists? ⇒ Boolean
-
#initialize(options = {}) ⇒ PlaylistItem
constructor
A new instance of PlaylistItem.
Methods included from Associations
Methods included from Actions::Update
Constructor Details
#initialize(options = {}) ⇒ PlaylistItem
Returns a new instance of PlaylistItem.
7 8 9 10 11 12 13 14 |
# File 'lib/yt/models/playlist_item.rb', line 7 def initialize( = {}) @id = [:id] @auth = [:auth] if [:snippet] @position = [:snippet]['position'] @video = Video.new video_params_for end end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/yt/models/playlist_item.rb', line 5 def id @id end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
5 6 7 |
# File 'lib/yt/models/playlist_item.rb', line 5 def position @position end |
#video ⇒ Object (readonly)
Returns the value of attribute video.
5 6 7 |
# File 'lib/yt/models/playlist_item.rb', line 5 def video @video end |
Instance Method Details
#delete ⇒ Object
16 17 18 19 |
# File 'lib/yt/models/playlist_item.rb', line 16 def delete do_delete {@id = nil} !exists? end |
#exists? ⇒ Boolean
21 22 23 |
# File 'lib/yt/models/playlist_item.rb', line 21 def exists? !@id.nil? end |