summaryrefslogtreecommitdiff
path: root/tests/ruby/xkbparser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ruby/xkbparser.rb')
-rw-r--r--tests/ruby/xkbparser.rb18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/ruby/xkbparser.rb b/tests/ruby/xkbparser.rb
index a023dca6..cc67c447 100644
--- a/tests/ruby/xkbparser.rb
+++ b/tests/ruby/xkbparser.rb
@@ -37,6 +37,7 @@ class Symbols < Hash
end
alias get_original []
+ alias keys_original keys
#
# Get the symbol, trying first own definitions, then walking through all
@@ -58,16 +59,23 @@ class Symbols < Hash
end
#
- # Approximate size - does not take into account overlapping key definitions
+ # All keys - including the ones specified in the included sections
#
- def rough_size()
- @includedSyms.inject(size) do | sum, symsName |
- syms = @symbolsList[symsName]
- syms.size + sum
+ def keys()
+ @includedSyms.inject(keys_original) do | rv, symsName |
+ syms = @symbolsList[symsName]
+ rv | syms.keys
end
end
#
+ # Size - takes into account overlapping key definitions
+ #
+ def size()
+ keys.size()
+ end
+
+ #
# Create a hash including all elements of this hash which are not in the
# other hash, use symbols + and * for marking the elements which existed in
# the original hash (+ if not existed)