Advertisement
lagranzotto

Album.rb

Oct 7th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.59 KB | None | 0 0
  1. class Album
  2.    
  3.     attr_accessor :compilation,
  4.                   :title,
  5.                   :year,
  6.                   :title,
  7.                   :track_count,
  8.                   :total_time,
  9.                   :trackList,
  10.                   :coverList
  11.  
  12.     def initialize(song)
  13.         if song.instance_of? Song
  14.             @compilation = song.tags[:compilation]
  15.             @title = song.album
  16.             @year = song.year
  17.             @track_count = song.track_count
  18.         end
  19.         @trackList = []
  20.         @coverList = []
  21.     end
  22.  
  23.     def to_s
  24.         self.inspect
  25.     end
  26.  
  27.     def ==(an_album)
  28.         @compilation == an_album.compilation &&
  29.         @title == an_album.title &&
  30.         @year = an_album.year &&
  31.         @track_count = an_album.track_count
  32.     end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement