Class: NCPP::CommandRegistry
Constant Summary
Constants inherited from Hash
Hash::KEY_SUGGEST_JARO_WEIGHT, Hash::KEY_SUGGEST_LEVENSHTEIN_WEIGHT, Hash::KEY_SUGGEST_THRESH
Instance Method Summary collapse
-
#initialize(commands, aliases: {}) ⇒ CommandRegistry
constructor
A new instance of CommandRegistry.
Methods inherited from Hash
Constructor Details
#initialize(commands, aliases: {}) ⇒ CommandRegistry
Returns a new instance of CommandRegistry.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ncpp/commands.rb', line 11 def initialize(commands, aliases: {}) @aliases = aliases h = commands.dup aliases.each do |alias_name, target| h[alias_name] = h[target] end super() merge!(h) end |