Class: Yt::Models::PlaylistItem
- Defined in:
- lib/yt/models/playlist_item.rb
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
Constructor Details
#initialize(options = {}) ⇒ PlaylistItem
Returns a new instance of PlaylistItem.
8 9 10 11 12 13 14 15 |
# File 'lib/yt/models/playlist_item.rb', line 8 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.
6 7 8 |
# File 'lib/yt/models/playlist_item.rb', line 6 def id @id end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
6 7 8 |
# File 'lib/yt/models/playlist_item.rb', line 6 def position @position end |
#video ⇒ Object (readonly)
Returns the value of attribute video.
6 7 8 |
# File 'lib/yt/models/playlist_item.rb', line 6 def video @video end |
Instance Method Details
#delete ⇒ Object
17 18 19 20 |
# File 'lib/yt/models/playlist_item.rb', line 17 def delete do_delete {@id = nil} !exists? end |
#exists? ⇒ Boolean
22 23 24 |
# File 'lib/yt/models/playlist_item.rb', line 22 def exists? !@id.nil? end |