Class: Speedflow::Plugin::Flowdock::PluginCore

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

Overview

Plugin core

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments) ⇒ PluginCore

Initialize.

arguments - Hash of arguments.

Examples

Plugin.new({})
# => <Speedflow::Plugin::Flowdock::PluginCore>

Returns nothing.



28
29
30
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 28

def initialize(arguments)
  @arguments = arguments
end

Instance Attribute Details

#clientObject

Public: Plugin client.

Returns Client instance.



56
57
58
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 56

def client
  @client ||= Client.new(@config, @prompt)
end

#configObject

Public: Plugin configuration.

Returns Configuration instance.



49
50
51
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 49

def config
  @config ||= Configuration.new(@arguments)
end

#promptObject

Public: Plugin prompt.

Returns Prompt instance.



63
64
65
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 63

def prompt
  @prompt ||= Prompt.new
end

Instance Method Details

#action_notifyObject

Public: Notify.

Returns nothing.



35
36
37
38
39
40
41
42
43
44
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 35

def action_notify
  flow_id_or_token = config.by_input('flow', config.by_config('flow'))

  message = config.by_input('message')
  tags    = config.by_input('tags').split(',')

  client.notify(flow_id_or_token, message, tags)

  prompt.ok '[FLOWDOCK] Flow was notified'
end