Class: ROM::Components::Gateway

Inherits:
Core
  • Object
show all
Defined in:
lib/rom/components/gateway.rb

Instance Attribute Summary

Attributes inherited from Core

#config, #gateway, #provider

Instance Method Summary collapse

Methods inherited from Core

#abstract, #apply_external_plugins, #apply_plugins, #components, #gateway?, #gateway_plugins, #id, #inflector, inherited, #key, #local_components, #namespace, #notifications, #plugin_options, #plugins, #provider_plugins, #trigger, #type

Methods included from Initializer

extended

Instance Method Details

#adapterObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



26
27
28
# File 'lib/rom/components/gateway.rb', line 26

def adapter
  config.adapter
end

#buildObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rom/components/gateway.rb', line 11

def build
  gateway = adapter.is_a?(ROM::Gateway) ? adapter : setup

  # TODO: once Gateway is unified with the rest of component types, this
  #       won't be needed as it'll happen automatically when inheriting
  #       config settings
  gateway_config.plugins.concat(gateway.class.config.component.plugins)

  gateway.instance_variable_set("@config", gateway_config)
  gateway.use_logger(config.logger) if config.logger

  gateway
end