Class: Shh::EntryMenu
- Inherits:
-
Object
- Object
- Shh::EntryMenu
- Includes:
- ShellShock::Context, Command
- Defined in:
- lib/shh/entry_menu.rb
Instance Method Summary collapse
-
#initialize(io, entry) ⇒ EntryMenu
constructor
A new instance of EntryMenu.
- #refresh_commands ⇒ Object
Methods included from Command
Constructor Details
#initialize(io, entry) ⇒ EntryMenu
Returns a new instance of EntryMenu.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/shh/entry_menu.rb', line 8 def initialize io, entry @io, @entry = io, entry show_command = load_command(:show_key, entry, io) edit_command = load_command(:edit_key, entry, io) @commands = { 'ls' => load_command(:list_keys, entry, io), 'set' => load_command(:set_key, entry, io), 'edit' => edit_command, 'cat' => show_command, 'less' => show_command, 'more' => show_command, 'cp' => load_command(:copy_key, entry, io), 'launch' => load_command(:launch_key, entry, io), 'rm' => load_command(:remove_key, entry, io), 'exec' => load_command(:execute_key, entry, io) } end |
Instance Method Details
#refresh_commands ⇒ Object
26 27 28 |
# File 'lib/shh/entry_menu.rb', line 26 def refresh_commands @prompt_text = "shh:#{@entry['name']} > " end |