diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2018-11-03 21:58:16 +0800 |
---|---|---|
committer | Kyrylo Silin <silin@kyrylo.org> | 2018-11-03 22:08:52 +0800 |
commit | 82d683b146094dec1ac4dc09f56208df2e1dde7e (patch) | |
tree | 0927e5b3267667d19ee95b262aed68e489f4a154 /lib/pry/commands/change_prompt.rb | |
parent | 98c5e95064524a603dbaef03c94c97a6b665b9c2 (diff) | |
download | pry-prompt-api.tar.gz |
prompt: add basic API for adding promptsprompt-api
Fixes #1836 (Add an API for adding new prompts)
Diffstat (limited to 'lib/pry/commands/change_prompt.rb')
-rw-r--r-- | lib/pry/commands/change_prompt.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/pry/commands/change_prompt.rb b/lib/pry/commands/change_prompt.rb index 13d36cbb..f20b741a 100644 --- a/lib/pry/commands/change_prompt.rb +++ b/lib/pry/commands/change_prompt.rb @@ -11,16 +11,12 @@ class Pry::Command::ChangePrompt < Pry::ClassCommand BANNER def process(prompt) - if prompt_map.key?(prompt) - _pry_.prompt = prompt_map[prompt][:value] + if Pry::Prompt.all.key?(prompt) + _pry_.prompt = Pry::Prompt.all[prompt][:value] else raise Pry::CommandError, "'#{prompt}' isn't a known prompt!" end end -private - def prompt_map - Pry::Prompt::MAP - end Pry::Commands.add_command(self) end |