Class: Quartet
- Inherits:
-
Competitor
- Object
- Competitor
- Quartet
- Defined in:
- lib/barbershop_contestants/competitor.rb
Instance Attribute Summary collapse
-
#baritone ⇒ Object
Returns the value of attribute baritone.
-
#bass ⇒ Object
Returns the value of attribute bass.
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#lead ⇒ Object
Returns the value of attribute lead.
-
#members ⇒ Object
Returns the value of attribute members.
-
#tenor ⇒ Object
Returns the value of attribute tenor.
Attributes inherited from Competitor
#district, #name, #performances, #type
Class Method Summary collapse
Instance Method Summary collapse
- #format_members(member_string) ⇒ Object
-
#initialize(arg_hash) ⇒ Quartet
constructor
A new instance of Quartet.
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
#baritone ⇒ Object
Returns the value of attribute baritone.
39 40 41 |
# File 'lib/barbershop_contestants/competitor.rb', line 39 def @baritone end |
#bass ⇒ Object
Returns the value of attribute bass.
39 40 41 |
# File 'lib/barbershop_contestants/competitor.rb', line 39 def bass @bass end |
#comments ⇒ Object
Returns the value of attribute comments.
39 40 41 |
# File 'lib/barbershop_contestants/competitor.rb', line 39 def comments @comments end |
#lead ⇒ Object
Returns the value of attribute lead.
39 40 41 |
# File 'lib/barbershop_contestants/competitor.rb', line 39 def lead @lead end |
#members ⇒ Object
Returns the value of attribute members.
39 40 41 |
# File 'lib/barbershop_contestants/competitor.rb', line 39 def members @members end |
#tenor ⇒ Object
Returns the value of attribute tenor.
39 40 41 |
# File 'lib/barbershop_contestants/competitor.rb', line 39 def tenor @tenor end |
Class Method Details
.all ⇒ Object
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 |