Class: AppleMusic::ChartResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/apple_music/chart_response.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props = {}) ⇒ ChartResponse

Returns a new instance of ChartResponse.



8
9
10
11
12
13
# File 'lib/apple_music/chart_response.rb', line 8

def initialize(props = {})
  @albums       = build_chart(props['albums'])&.data || []
  @music_videos = build_chart(props['music-videos'])&.data || []
  @songs        = build_chart(props['songs'])&.data || []
  @playlists    = build_chart(props['playlists'])&.data || []
end

Instance Attribute Details

#albumsObject (readonly)

Returns the value of attribute albums.



6
7
8
# File 'lib/apple_music/chart_response.rb', line 6

def albums
  @albums
end

#music_videosObject (readonly)

Returns the value of attribute music_videos.



6
7
8
# File 'lib/apple_music/chart_response.rb', line 6

def music_videos
  @music_videos
end

#playlistsObject (readonly)

Returns the value of attribute playlists.



6
7
8
# File 'lib/apple_music/chart_response.rb', line 6

def playlists
  @playlists
end

#songsObject (readonly)

Returns the value of attribute songs.



6
7
8
# File 'lib/apple_music/chart_response.rb', line 6

def songs
  @songs
end