Method: Textbringer::Keymap#lookup

Defined in:
lib/textbringer/keymap.rb

#lookup(key_sequence) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/textbringer/keymap.rb', line 28

def lookup(key_sequence)
  case key_sequence.size
  when 0
    raise ArgumentError, "Empty key"
  when 1
    @map[key_sequence.first]
  else
    k, *ks = key_sequence
    @map[k]&.lookup(ks)
  end
end