Class: Speedflow::Plugin::Flowdock::Prompt

Inherits:
Object
  • Object
show all
Defined in:
lib/speedflow/plugin/flowdock/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.



29
30
31
# File 'lib/speedflow/plugin/flowdock/prompt.rb', line 29

def method_missing(method, *args, &block)
  prompt.send(method, *args, &block)
end

Instance Attribute Details

#promptObject

Public: TTY prompt.

Returns ::TTY::Prompt instance.



36
37
38
# File 'lib/speedflow/plugin/flowdock/prompt.rb', line 36

def prompt
  @prompt ||= ::TTY::Prompt.new
end

Instance Method Details

#errors(exception) ⇒ Object

Public: Errors from Flowdock exception.

exception - Flowdock::ApiError.

Returns nothing.



17
18
19
20
# File 'lib/speedflow/plugin/flowdock/prompt.rb', line 17

def errors(exception)
  prompt.error 'Flowdock errors'
  prompt.warn exception.message
end