Class: Brainzz::PlaylistItemsWrapper
- Inherits:
-
Object
- Object
- Brainzz::PlaylistItemsWrapper
- Defined in:
- lib/brainzz/models/playlist_items_wrapper.rb
Instance Attribute Summary collapse
-
#next_page_token ⇒ Object
Returns the value of attribute next_page_token.
-
#playlist_items ⇒ Object
Returns the value of attribute playlist_items.
Instance Method Summary collapse
-
#initialize(playlist_data = {}) ⇒ PlaylistItemsWrapper
constructor
A new instance of PlaylistItemsWrapper.
- #last_page? ⇒ Boolean
Constructor Details
#initialize(playlist_data = {}) ⇒ PlaylistItemsWrapper
Returns a new instance of PlaylistItemsWrapper.
5 6 7 8 9 10 11 12 13 |
# File 'lib/brainzz/models/playlist_items_wrapper.rb', line 5 def initialize(playlist_data = {}) @playlist_items = [] items = playlist_data['items'] || [] items.each do |playlist_item| @playlist_items << PlaylistItem.new(playlist_item) end @next_page_token = playlist_data['nextPageToken'] end |
Instance Attribute Details
#next_page_token ⇒ Object
Returns the value of attribute next_page_token.
3 4 5 |
# File 'lib/brainzz/models/playlist_items_wrapper.rb', line 3 def next_page_token @next_page_token end |
#playlist_items ⇒ Object
Returns the value of attribute playlist_items.
3 4 5 |
# File 'lib/brainzz/models/playlist_items_wrapper.rb', line 3 def playlist_items @playlist_items end |
Instance Method Details
#last_page? ⇒ Boolean
15 16 17 |
# File 'lib/brainzz/models/playlist_items_wrapper.rb', line 15 def last_page? !next_page_token end |