Class: Outhad::Integrations::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/outhad/integrations/service.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|self.class.config| ... } ⇒ Service

Returns a new instance of Service.

Yields:



6
7
8
# File 'lib/outhad/integrations/service.rb', line 6

def initialize
  yield(self.class.config) if block_given?
end

Class Method Details

.configObject



35
36
37
# File 'lib/outhad/integrations/service.rb', line 35

def config
  @config ||= Config.new
end

.connector_class(connector_type, connector_name) ⇒ Object



21
22
23
24
25
# File 'lib/outhad/integrations/service.rb', line 21

def connector_class(connector_type, connector_name)
  Object.const_get(
    "Outhad::Integrations::#{connector_type}::#{connector_name}::Client"
  )
end

.connectorsObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/outhad/integrations/service.rb', line 10

def connectors
  {
    source: build_connectors(
      ENABLED_SOURCES, "Source"
    ),
    destination: build_connectors(
      ENABLED_DESTINATIONS, "Destination"
    )
  }
end

.exception_reporterObject



31
32
33
# File 'lib/outhad/integrations/service.rb', line 31

def exception_reporter
  config.exception_reporter
end

.loggerObject



27
28
29
# File 'lib/outhad/integrations/service.rb', line 27

def logger
  config.logger || default_logger
end