def unregister (name_or_participant)
code = nil
entry = nil
list = get_list
if name_or_participant.is_a?(Symbol)
name_or_participant = name_or_participant.to_s
end
if name_or_participant.is_a?(String)
entry = list['list'].find { |re, pa| name_or_participant.match(re) }
return nil unless entry
code = entry.last if entry.last.is_a?(String)
else
code = @instantiated_participants.find { |k, v|
v == name_or_participant
}
return nil unless code
code = code.first
entry = list['list'].find { |re, pa| pa == code }
end
list['list'].delete(entry)
if r = @context.storage.put(list)
return unregister(name_or_participant, r)
end
@instantiated_participants.delete(code) if code
entry.first
end