Class: Brainzz::ChannelListWrapper

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel_list_data = {}) ⇒ ChannelListWrapper

Returns a new instance of ChannelListWrapper.



5
6
7
8
9
10
11
12
13
# File 'lib/brainzz/models/channel_list_wrapper.rb', line 5

def initialize(channel_list_data = {})
  @channel_list_items = []
  items = channel_list_data['items'] || []
  items.each do |channel_list_item|
    @channel_list_items << Channel.new(channel_list_item)
  end

  @next_page_token = channel_list_data['nextPageToken']
end

Instance Attribute Details

#channel_list_itemsObject

Returns the value of attribute channel_list_items.



3
4
5
# File 'lib/brainzz/models/channel_list_wrapper.rb', line 3

def channel_list_items
  @channel_list_items
end

#next_page_tokenObject

Returns the value of attribute next_page_token.



3
4
5
# File 'lib/brainzz/models/channel_list_wrapper.rb', line 3

def next_page_token
  @next_page_token
end

Instance Method Details

#last_page?Boolean

Returns:

  • (Boolean)


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

def last_page?
  !next_page_token
end