Class: Speedflow::Plugin::Flowdock::Client
- Inherits:
-
Object
- Object
- Speedflow::Plugin::Flowdock::Client
- Defined in:
- lib/speedflow/plugin/flowdock/client.rb
Overview
Flowdock client
Instance Attribute Summary collapse
-
#flowdock_client ⇒ Object
Public: Flowdock client.
-
#prompt ⇒ Object
Public: Prompt.
Instance Method Summary collapse
-
#initialize(config, prompt) ⇒ Client
constructor
Initialize.
-
#notify(flow_id, message, tags) ⇒ Object
Public: Notify.
-
#safe ⇒ Object
Public: Safe process Flowdock action.
Constructor Details
#initialize(config, prompt) ⇒ Client
25 26 27 28 |
# File 'lib/speedflow/plugin/flowdock/client.rb', line 25 def initialize(config, prompt) @config = config @prompt = prompt end |
Instance Attribute Details
#flowdock_client ⇒ Object
Public: Flowdock client.
Returns ::Flowdock::Client instance.
58 59 60 |
# File 'lib/speedflow/plugin/flowdock/client.rb', line 58 def flowdock_client @flowdock_client ||= ::Flowdock::Client.new(@config.auth) end |
Instance Method Details
#notify(flow_id, message, tags) ⇒ Object
Public: Notify.
flow_id - Flow ID. message - String of message. tags - Array of tags / Just add “Speedflow” tags 8-).
Returns nothing.
37 38 39 40 41 42 43 |
# File 'lib/speedflow/plugin/flowdock/client.rb', line 37 def notify(flow_id, , ) safe do = ['Speedflow'].concat() flowdock_client.( flow: flow_id, content: , tags: ) end end |
#safe ⇒ Object
Public: Safe process Flowdock action.
Returns nothing.
48 49 50 51 52 53 |
# File 'lib/speedflow/plugin/flowdock/client.rb', line 48 def safe yield rescue ::Flowdock::ApiError => exception prompt.errors exception abort end |