Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 3140562a authored by Lucas Nussbaum's avatar Lucas Nussbaum
Browse files

[dev/gen/ref-api] ensure that an exception is raised next time a key is missing

parent 317157b5
No related branches found
No related tags found
No related merge requests found
......@@ -126,7 +126,7 @@ class ::Hash
# Sort a hash according to the position of the key in the array.
def sort_by_array(array)
Hash[sort_by{|key, _| array.index(key) || length}]
Hash[sort_by{|key, _| array.index(key) or raise "Unknown key to sort array: #{key}" }]
end
# Add an element composed of nested Hashes made from elements found in "array" argument
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment