Class: Rsvp::Salutation::HusbandWifeAndChildren
Instance Attribute Summary
#family
Instance Method Summary
collapse
#initialize, #to_s
Instance Method Details
#children ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'app/models/rsvp/salutation/husband_wife_and_children.rb', line 6
def children
names = ""
children = family.people.children
children.each_with_index do |child, index|
names << " and" if children.size > 1 && (index + 1) == children.size
names << " #{child.first_name}"
end
names.strip
end
|
#male ⇒ Object
3
4
5
|
# File 'app/models/rsvp/salutation/husband_wife_and_children.rb', line 3
def male
family.people.adult_males.first
end
|
#template ⇒ Object
15
16
17
|
# File 'app/models/rsvp/salutation/husband_wife_and_children.rb', line 15
def template
"Mr. and Mrs. [[male__first_name]] [[male__last_name]], [[children]]"
end
|