26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/lita/handlers/update_team.rb', line 26
def update(response)
team_name = response.match_data[1]
if team = get_team(team_name)
attribute = response.match_data[2].to_sym
value = parse_attribute_value(attribute, response.match_data[3])
team[attribute] = value
save_team(team)
response.reply(
render_template(:team_updated,
team_name: team_name,
attribute: attribute,
value: value
)
)
else
response.reply(
render_template(:team_not_found, team_name: team_name)
)
end
end
|