Module: EDI

Extended by:
Schedule
Includes:
Configuration, HTTPUtilities
Defined in:
lib/edi.rb,
lib/edi/cli.rb,
lib/edi/dsl.rb,
lib/edi/job.rb,
lib/edi/core.rb,
lib/edi/logger.rb,
lib/edi/service.rb,
lib/edi/version.rb,
lib/edi/postable.rb,
lib/edi/schedule.rb,
lib/edi/exceptions.rb,
lib/edi/application.rb,
lib/edi/environment.rb,
lib/edi/interpreter.rb,
lib/edi/api/response.rb,
lib/edi/configuration.rb,
lib/edi/http_utilities.rb,
lib/edi/test_support/test_support.rb,
lib/edi/utilities/array_responder.rb

Defined Under Namespace

Modules: API, Configuration, DSL, Environment, HTTPUtilities, Postable, Schedule, TestSupport Classes: Application, ArrayResponder, CLI, Core, Exception, Interpreter, Job, Logger, Service, ThirdPartyAPIFailure, UnfitEnvironmentException

Constant Summary collapse

VERSION =
"0.4.9"

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Schedule

keepalive, schedule

Methods included from Configuration

included

Methods included from HTTPUtilities

included

Class Attribute Details

.services ⇒ Object

Returns the value of attribute services.



27
28
29
# File 'lib/edi.rb', line 27

def services
  @services
end

.websocket ⇒ Object

Returns the value of attribute websocket.



27
28
29
# File 'lib/edi.rb', line 27

def websocket
  @websocket
end

Class Method Details

.add_channel(channel) ⇒ Object



78
79
80
# File 'lib/edi.rb', line 78

def add_channel(channel)
  channels << channel
end

.bootstrap ⇒ Object



41
42
43
44
# File 'lib/edi.rb', line 41

def bootstrap
  require File.join EDI.root, "config", "environment"
  EDI::Application.initialize!
end

.bot_name ⇒ Object



66
67
68
# File 'lib/edi.rb', line 66

def bot_name
  self.config.bot_name
end

.bot_token ⇒ Object



70
71
72
# File 'lib/edi.rb', line 70

def bot_token
  @bot_token ||= ENV["SLACK_EDI_TOKEN"]
end

.channels ⇒ Object



74
75
76
# File 'lib/edi.rb', line 74

def channels
  @channels ||= []
end

.clear_services ⇒ Object



37
38
39
# File 'lib/edi.rb', line 37

def clear_services
  @services = []
end

.env ⇒ Object



50
51
52
# File 'lib/edi.rb', line 50

def env
  self.config.environment ||= ActiveSupport::StringInquirer.new(ENV["edi_ENV"] || ENV["RACK_ENV"] || "development")
end

.env=(environment) ⇒ Object



54
55
56
# File 'lib/edi.rb', line 54

def env=(environment)
  self.config.environment = ActiveSupport::StringInquirer.new(environment)
end

.register_services(*args) ⇒ Object



32
33
34
35
# File 'lib/edi.rb', line 32

def register_services(*args)
  args.each { |klass| services << klass}
  EDI::Interpreter.build_determine_service
end

.root ⇒ Object



46
47
48
# File 'lib/edi.rb', line 46

def root
  self.config.root
end

.runner ⇒ Object



62
63
64
# File 'lib/edi.rb', line 62

def runner
  ServiceRunner
end

.send_message(message, channel_name: "general", channel_id: nil) ⇒ Object



82
83
84
# File 'lib/edi.rb', line 82

def send_message(message, channel_name: "general", channel_id: nil)
  EDI.websocket.send_message(message, channel_name: channel_name, channel_id: channel_id)
end