Module: Shh::Command

Included in:
EntriesMenu, EntryMenu
Defined in:
lib/shh/commands.rb

Defined Under Namespace

Modules: EntriesCommand, HistoricEntryCommand, KeyCommand Classes: CommitChanges, CopyKey, DiffEntry, EditKey, ExecuteKey, ExhumeEntry, LaunchKey, ListEntries, ListKeys, OpenEntry, RemoveKey, SetKey, ShowHistory, ShowKey

Instance Method Summary collapse

Instance Method Details

#camelize(s) ⇒ Object



3
4
5
# File 'lib/shh/commands.rb', line 3

def camelize s
  s.to_s.split('_').map{|word| word.capitalize}.join
end

#load_command(name, *args) ⇒ Object



7
8
9
10
# File 'lib/shh/commands.rb', line 7

def load_command name, *args
  require "shh/command/#{name}"
  Command.const_get(camelize(name)).new(*args)
end