Class: Muzak::Album

Inherits:
Object
  • Object
show all
Defined in:
lib/muzak/album.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, album_hash) ⇒ Album

instead of passing an album hash directly from the index, this should really just take a title and an array of Song objects.



8
9
10
11
12
13
14
15
16
17
# File 'lib/muzak/album.rb', line 8

def initialize(title, album_hash)
  @title = title
  @cover_art = album_hash["cover"]

  if album_hash["deep-songs"]
    @songs = album_hash["deep-songs"]
  else
    @songs = album_hash["songs"].map { |s| Song.new(s) }
  end
end

Instance Attribute Details

#cover_artObject (readonly)

Returns the value of attribute cover_art.



3
4
5
# File 'lib/muzak/album.rb', line 3

def cover_art
  @cover_art
end

#songsObject (readonly)

Returns the value of attribute songs.



3
4
5
# File 'lib/muzak/album.rb', line 3

def songs
  @songs
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/muzak/album.rb', line 3

def title
  @title
end