Module: Hydramata

Extended by:
ActiveSupport::Autoload
Defined in:
lib/hydramata/core.rb,
lib/hydramata/services.rb,
lib/hydramata/exceptions.rb,
lib/hydramata/core/runner.rb,
lib/hydramata/core/railtie.rb,
lib/hydramata/core/version.rb,
lib/hydramata/configuration.rb,
lib/hydramata/core/translator.rb,
lib/hydramata/core/named_callbacks.rb

Defined Under Namespace

Modules: Core Classes: Configuration, ConfigurationError, Services

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

See Also:



13
14
15
16
# File 'lib/hydramata/core.rb', line 13

def configuration
  require 'hydramata/configuration'
  @configuration ||= Configuration.new
end

Class Method Details

.configure(&block) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/hydramata/core.rb', line 23

def configure(&block)
  @configuration_block = block

  # The Rails load sequence means that some of the configured Targets may
  # not be loaded; As such I am not calling configure! instead relying on
  # Hydra::RemoteIdentifier::Railtie to handle the configure! call
  configure! unless defined?(Rails)
end

.configure!Object



32
33
34
35
36
37
# File 'lib/hydramata/core.rb', line 32

def configure!
  if @configuration_block.respond_to?(:call)
    @configuration_block.call(configuration)
    @configuration_block = nil
  end
end