3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/libis/tools/metadata/parser/patch.rb', line 3
def element_match_hash(tree, exp, bindings)
return false if exp.size < tree.size
exp.each do |expected_key, expected_value|
if expected_key.to_s =~ /^(.*)\?$/
expected_key = expected_key.is_a?(Symbol) ? $1.to_sym : $1
return true unless tree.has_key? expected_key
end
return false unless tree.has_key? expected_key
value = tree[expected_key]
return false unless element_match(value, expected_value, bindings)
end
true
end
|