Class: Quartet

Inherits:
Competitor show all
Defined in:
lib/barbershop_contestants/competitor.rb

Instance Attribute Summary collapse

Attributes inherited from Competitor

#district, #name, #performances, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Competitor

create, fill_find_or_create, find_or_create, #save

Constructor Details

#initialize(arg_hash) ⇒ Quartet

Returns a new instance of Quartet.



41
42
43
44
45
46
47
48
# File 'lib/barbershop_contestants/competitor.rb', line 41

def initialize(arg_hash)
  self.name = arg_hash[:name]
  self.type = 'quartet'
  self.district = arg_hash[:district]
  self.performances = (arg_hash[:performances] || [])
  self.comments = arg_hash[:comments]
  self.members  = self.format_members(arg_hash[:members])
end

Instance Attribute Details

#baritoneObject

Returns the value of attribute baritone.



39
40
41
# File 'lib/barbershop_contestants/competitor.rb', line 39

def baritone
  @baritone
end

#bassObject

Returns the value of attribute bass.



39
40
41
# File 'lib/barbershop_contestants/competitor.rb', line 39

def bass
  @bass
end

#commentsObject

Returns the value of attribute comments.



39
40
41
# File 'lib/barbershop_contestants/competitor.rb', line 39

def comments
  @comments
end

#leadObject

Returns the value of attribute lead.



39
40
41
# File 'lib/barbershop_contestants/competitor.rb', line 39

def lead
  @lead
end

#membersObject

Returns the value of attribute members.



39
40
41
# File 'lib/barbershop_contestants/competitor.rb', line 39

def members
  @members
end

#tenorObject

Returns the value of attribute tenor.



39
40
41
# File 'lib/barbershop_contestants/competitor.rb', line 39

def tenor
  @tenor
end

Class Method Details

.allObject



55
56
57
# File 'lib/barbershop_contestants/competitor.rb', line 55

def self.all
  @@all.find_all { |c| c.type == "quartet" }
end

Instance Method Details

#format_members(member_string) ⇒ Object



50
51
52
53
# File 'lib/barbershop_contestants/competitor.rb', line 50

def format_members(member_string)
  self.members = member_string
  # TODO: modify to pull out the members and put them in their own hashes
end