summaryrefslogblamecommitdiffstats
path: root/lib/band.rb
blob: 22778ff90da19c48f4f7351b15aad8d23dde2e6b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                                    
 












                                             
require_relative 'contact'
require_relative 'member'
require_relative 'song'

class Band
  attr_reader :name, :city, :website, :label, :short_bio, :contact, :members, :songs

  def initialize(params)
    @name = params['name']
    @city = params['city']
    @website = params['website']
    @label = params['label']
    @short_bio = params['shortbio']

    @contact = Contact.new(params['contact'])

    @members = []
    params['members'].each do |k, m|
      @members << Member.new(m)
    end

    @songs = []
    params['songs'].each do |k, s|
      @songs << Song.new(s)
    end
  end
end