mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 08:43:37 +02:00
Make epp code map dynamic
This commit is contained in:
parent
c166967467
commit
5258c43faa
5 changed files with 57 additions and 28 deletions
|
@ -51,8 +51,12 @@ module EppErrors
|
|||
end
|
||||
|
||||
def find_epp_code(msg)
|
||||
self.class::EPP_CODE_MAP.each do |code, values|
|
||||
return code if values.include?(msg)
|
||||
epp_code_map.each do |code, values|
|
||||
values.each do |x|
|
||||
t = errors.generate_message(*x) if x.is_a?(Array)
|
||||
t = x if x.is_a?(String)
|
||||
return code if t == msg
|
||||
end
|
||||
end
|
||||
nil
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue