Class: Brainzz::PlaylistItemsWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/brainzz/models/playlist_items_wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_tokenObject

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_itemsObject

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/brainzz/models/playlist_items_wrapper.rb', line 15

def last_page?
  !next_page_token
end