class Canis::Utils::MapNode
# this allows us to play a bit with the map, and allocate one action to another key # get_action_map() = get_action(32) # But we will hold on this unless absolutely necessary. 2014-05-12 - 22:36 CANIS.
def get_action keycode @_key_map[keycode] end def get_action_map @_key_map end
Attributes
action[RW]
map[RW]
Public Class Methods
new(arg=nil)
click to toggle source
# File lib/canis/core/widgets/rwidget.rb, line 516 def initialize arg=nil @map = Hash.new {|hash, key| hash[key] = MapNode.new } end
Public Instance Methods
fetch(key, deft=nil)
click to toggle source
fetch / get returns a node, or nil. if node, then use node.action
# File lib/canis/core/widgets/rwidget.rb, line 523 def fetch key, deft=nil @map.fetch(key, deft) end
put(key, value)
click to toggle source
# File lib/canis/core/widgets/rwidget.rb, line 519 def put key, value @map[key].action = value end