Class: Speedflow::Plugin::Prompt

Inherits:
Object
  • Object
show all
Defined in:
lib/speedflow/plugin/prompt.rb

Overview

Plugin prompt

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#promptObject

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.message
end