summaryrefslogtreecommitdiffstats
path: root/lib/member.rb
blob: 598b5f4aa528a4a9e2a0e7d3d95a665bdee59d7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Member
  attr_reader :name, :instrument, :age

  def initialize(params = nil)
    if params
      @name = params['name']
      @instrument = params['instrument']
      @age = params['age'].to_i
    else
      @name = ''
      @instrument = ''
      @age = 0
    end
  end

  def to_s
    [name, instrument, age].join(', ')
  end
end