Sha256: 024d012b20581373cc7942ecea318420a4b71ffc8bb7bb02de0e1d96877f4aef
Contents?: true
Size: 710 Bytes
Versions: 37
Compression:
Stored size: 710 Bytes
Contents
module Redcar class Keymap def self.build(name, platform, &block) Builder.new(name, platform, &block).keymap end attr_reader :name, :platforms attr_accessor :map def initialize(name, platforms) @name, @platforms = name, [*platforms] @map = {} end def link(key_string, command) @map[key_string] = command end def command(key_string) @map[key_string] end def command_to_key(command) @map.invert[command] end def length @map.length end def merge(other) keymap = Keymap.new(@name, @platforms) keymap.map = @map.merge(other.map) keymap end end end
Version data entries
37 entries across 37 versions & 1 rubygems