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.



25
26
27
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 25

def initialize(arguments)
  @arguments = arguments
end

Instance Attribute Details

#clientObject

Public: Plugin client.

Returns Client instance.



53
54
55
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 53

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

#configObject

Public: Plugin configuration.

Returns Configuration instance.



46
47
48
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 46

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

#promptObject

Public: Plugin prompt.

Returns Prompt instance.



60
61
62
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 60

def prompt
  @prompt ||= Prompt.new
end

Instance Method Details

#action_notifyObject

Public: Notify.

Returns nothing.



32
33
34
35
36
37
38
39
40
41
# File 'lib/speedflow/plugin/flowdock/plugin_core.rb', line 32

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