Module: Conductor

Defined in:
lib/nf-conductor.rb,
lib/nf-conductor/version.rb,
lib/nf-conductor/http/model.rb,
lib/nf-conductor/http/tasks.rb,
lib/nf-conductor/http/metadata.rb,
lib/nf-conductor/http/workflow.rb,
lib/nf-conductor/worker/worker.rb,
lib/nf-conductor/http/connection.rb,
lib/nf-conductor/coordinator/coordinator.rb

Defined Under Namespace

Classes: Configuration, Connection, Coordinator, Metadata, Model, Tasks, Worker, Workflow

Constant Summary collapse

SERVICE_URI_DEVELOPMENT =
'http://cpeworkflowdevint.dyntest.netflix.net:7001/'
SERVICE_URI_TESTING =
'http://cpeworkflowtestintg.dyntest.netflix.net:7001/'
SERVICE_URI_PRODUCTION =
'http://cpeworkflow.dynprod.netflix.net:7001/'
VERSION =
'0.0.7'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config.



19
20
21
# File 'lib/nf-conductor.rb', line 19

def config
  @config
end

Class Method Details

.configure {|config| ... } ⇒ Object

Yields:



21
22
23
24
# File 'lib/nf-conductor.rb', line 21

def configure
  self.config ||= Configuration.new
  yield(config) if block_given?
end

.initialize(service_env, verbose: false) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/nf-conductor.rb', line 26

def initialize(service_env, verbose: false)
  configure if self.config.nil?
  self.config.service_env ||= service_env
  self.config.verbose ||= verbose

  # Ensure service_uri is set in configuration
  if self.config.service_env.nil? && self.config.service_uri.nil?
    raise "Service information is required"
  elsif self.config.service_uri
    # No action required
  elsif self.config.service_env
    self.config.service_uri = case self.config.service_env
                              when 'development'
                                SERVICE_URI_DEVELOPMENT
                              when 'testing'
                                SERVICE_URI_TESTING
                              when 'production'
                                SERVICE_URI_PRODUCTION
                              end
  end
end