class Bcome::Registry::CommandList

Attributes

list[R]

Public Class Methods

new() click to toggle source
# File lib/objects/registry/command_list.rb, line 9
def initialize
  @list = {}
  @groups_for_nodes = {}
end

Public Instance Methods

add_group_for_node(node, group) click to toggle source
# File lib/objects/registry/command_list.rb, line 14
def add_group_for_node(node, group)
  @groups_for_nodes[node.keyed_namespace] = group
end
command_in_list?(node, command_name) click to toggle source
# File lib/objects/registry/command_list.rb, line 26
def command_in_list?(node, command_name)
  @list.key?(node.keyed_namespace) && @list[node.keyed_namespace].include?(command_name.to_sym)
end
group_for_node(node) click to toggle source
# File lib/objects/registry/command_list.rb, line 18
def group_for_node(node)
  @groups_for_nodes[node.keyed_namespace]
end
register(node, command_name) click to toggle source
# File lib/objects/registry/command_list.rb, line 22
def register(node, command_name)
  @list[node.keyed_namespace] ? (@list[node.keyed_namespace] << command_name) : (@list[node.keyed_namespace] = [command_name])
end
teardown!() click to toggle source
# File lib/objects/registry/command_list.rb, line 30
def teardown!
  @groups_for_nodes = {}
  @list = {}
end