Class: Multiwoven::Integrations::Service
- Inherits:
-
Object
- Object
- Multiwoven::Integrations::Service
- Defined in:
- lib/multiwoven/integrations/service.rb
Class Method Summary collapse
- .config ⇒ Object
- .connector_class(connector_type, connector_name) ⇒ Object
-
.connectors ⇒ Object
deep_dup, not dup: the entries are the clients' own memoized metadata, so a shallow copy lets one caller's mutation reach every later caller.
- .exception_reporter ⇒ Object
- .logger ⇒ Object
-
.reset_connectors! ⇒ Object
The build is memoized for the life of the process, so anything that changes what would be built has to clear it.
Instance Method Summary collapse
-
#initialize {|self.class.config| ... } ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize {|self.class.config| ... } ⇒ Service
Returns a new instance of Service.
6 7 8 |
# File 'lib/multiwoven/integrations/service.rb', line 6 def initialize yield(self.class.config) if block_given? end |
Class Method Details
.config ⇒ Object
37 38 39 |
# File 'lib/multiwoven/integrations/service.rb', line 37 def config @config ||= Config.new end |
.connector_class(connector_type, connector_name) ⇒ Object
23 24 25 26 27 |
# File 'lib/multiwoven/integrations/service.rb', line 23 def connector_class(connector_type, connector_name) Object.const_get( "Multiwoven::Integrations::#{connector_type}::#{connector_name}::Client" ) end |
.connectors ⇒ Object
deep_dup, not dup: the entries are the clients' own memoized metadata, so a shallow copy lets one caller's mutation reach every later caller.
12 13 14 15 |
# File 'lib/multiwoven/integrations/service.rb', line 12 def connectors built = built_connectors { source: built[:source].deep_dup, destination: built[:destination].deep_dup } end |
.exception_reporter ⇒ Object
33 34 35 |
# File 'lib/multiwoven/integrations/service.rb', line 33 def exception_reporter config.exception_reporter end |
.logger ⇒ Object
29 30 31 |
# File 'lib/multiwoven/integrations/service.rb', line 29 def logger config.logger || default_logger end |
.reset_connectors! ⇒ Object
The build is memoized for the life of the process, so anything that changes what would be built has to clear it.
19 20 21 |
# File 'lib/multiwoven/integrations/service.rb', line 19 def reset_connectors! @built_connectors = nil end |