-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathhelper_functions.rb
More file actions
47 lines (37 loc) · 1.06 KB
/
helper_functions.rb
File metadata and controls
47 lines (37 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Constructs the event name from its code
#
# event_name('men_march') #=> "Men's Monthly Triathlon"
# event_name('men_april') #=> "Men's Monthly Triathlon"
# event_name('ladies_march') #=> "Ladies' Monthly Triathlon"
# event_name('ladies_april') #=> "Ladies' Monthly Triathlon"
#
# [Extension: get it to work for any code e.g. men_december or men_xx]
def event_name
end
# Constructs the event date from its code
#
# event_date('men_march') #=> '15/3/2014'
# event_date('men_april') #=> '15/4/2014'
# event_date('ladies_march') #=> '15/3/2014'
# event_date('ladies_april') #=> '15/4/2014'
#
# You can assume the year is 2014 and the triathlon is always on the 15th.
def event_date
end
# Extracts the first name from a full name.
#
# first_name('Tom Close') #=> 'Tom'
# first_name('Alan Jones') #=> 'Alan'
#
def first_name(full_name)
end
# Extracts the first name from a full name.
#
# last_name('Tom Close') #=> 'Close'
# last_name('Alan Jones') #=> 'Jones'
#
# [Extension]
# last_name('Pierre de Fermat') #=> 'de Fermat'
#
def second_name(full_name)
end