summaryrefslogblamecommitdiffstats
path: root/lib/song.rb
blob: 482834e476ac7fa56697aecb2abcff3195ea150e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
          
                                                                   
 






                                                                
     



                        
   
class Song
  attr_reader :title, :time, :isrc, :composers, :performers, :notes

  def initialize(params = nil)
    @title = params ? params['title'] : ''
    @time = params ? params['time'] : ''
    @isrc = params ? params['isrc'] : ''
    @composers = params ? params['composers'].split("\n") : []
    @performers = params ? params['performers'].split("\n") : []
    @notes = params ? params['notes'] : ''
  end

  def to_s
    "#{title} (#{time})"
  end
end