Class: AppleMusic::ChartResponse
- Inherits:
-
Object
- Object
- AppleMusic::ChartResponse
- Defined in:
- lib/apple_music/chart_response.rb
Overview
Instance Attribute Summary collapse
-
#albums ⇒ Object
readonly
Returns the value of attribute albums.
-
#music_videos ⇒ Object
readonly
Returns the value of attribute music_videos.
-
#playlists ⇒ Object
readonly
Returns the value of attribute playlists.
-
#songs ⇒ Object
readonly
Returns the value of attribute songs.
Instance Method Summary collapse
-
#initialize(props = {}) ⇒ ChartResponse
constructor
A new instance of ChartResponse.
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
#albums ⇒ Object (readonly)
Returns the value of attribute albums.
6 7 8 |
# File 'lib/apple_music/chart_response.rb', line 6 def albums @albums end |
#music_videos ⇒ Object (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 |
#playlists ⇒ Object (readonly)
Returns the value of attribute playlists.
6 7 8 |
# File 'lib/apple_music/chart_response.rb', line 6 def playlists @playlists end |
#songs ⇒ Object (readonly)
Returns the value of attribute songs.
6 7 8 |
# File 'lib/apple_music/chart_response.rb', line 6 def songs @songs end |