Commit 3140562a authored by Lucas Nussbaum's avatar Lucas Nussbaum

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

parent 317157b5
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment