Class: Speedflow::Plugin::Prompt
- Inherits:
-
Object
- Object
- Speedflow::Plugin::Prompt
- Defined in:
- lib/speedflow/plugin/prompt.rb
Overview
Plugin prompt
Instance Attribute Summary collapse
-
#prompt ⇒ Object
Public: TTY prompt.
Instance Method Summary collapse
-
#errors(plugin_name, exception) ⇒ Object
Public: Errors.
-
#method_missing(method, *args, &block) ⇒ Object
Delegate.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
Delegate.
method - Method. args - Arguments. block - Block.
Returns wathever.
27 28 29 |
# File 'lib/speedflow/plugin/prompt.rb', line 27 def method_missing(method, *args, &block) prompt.send(method, *args, &block) end |
Instance Attribute Details
#prompt ⇒ Object
Public: TTY prompt.
Returns ::TTY::Prompt instance.
34 35 36 |
# File 'lib/speedflow/plugin/prompt.rb', line 34 def prompt @prompt ||= ::TTY::Prompt.new end |
Instance Method Details
#errors(plugin_name, exception) ⇒ Object
Public: Errors.
exception - StandardError.
Returns nothing.
15 16 17 18 |
# File 'lib/speedflow/plugin/prompt.rb', line 15 def errors(plugin_name, exception) prompt.error "#{plugin_name.downcase.capitalize} errors" prompt.warn exception. end |