Module: ROM

Extended by:
Global
Includes:
Dry::Core::Constants
Defined in:
core/lib/rom/constants.rb,
core/lib/rom/core.rb,
core/lib/rom/cache.rb,
core/lib/rom/setup.rb,
core/lib/rom/types.rb,
core/lib/rom/global.rb,
core/lib/rom/header.rb,
core/lib/rom/mapper.rb,
core/lib/rom/plugin.rb,
core/lib/rom/schema.rb,
core/lib/rom/struct.rb,
core/lib/rom/command.rb,
core/lib/rom/gateway.rb,
core/lib/rom/plugins.rb,
core/lib/rom/pipeline.rb,
core/lib/rom/registry.rb,
core/lib/rom/relation.rb,
core/lib/rom/attribute.rb,
core/lib/rom/container.rb,
core/lib/rom/lint/test.rb,
core/lib/rom/processor.rb,
core/lib/rom/auto_curry.rb,
core/lib/rom/data_proxy.rb,
core/lib/rom/mapper/dsl.rb,
core/lib/rom/schema/dsl.rb,
core/lib/rom/environment.rb,
core/lib/rom/initializer.rb,
core/lib/rom/lint/linter.rb,
core/lib/rom/open_struct.rb,
core/lib/rom/transaction.rb,
core/lib/rom/transformer.rb,
core/lib/rom/core/version.rb,
core/lib/rom/lint/gateway.rb,
core/lib/rom/memory/types.rb,
core/lib/rom/array_dataset.rb,
core/lib/rom/command_proxy.rb,
core/lib/rom/commands/lazy.rb,
core/lib/rom/configuration.rb,
core/lib/rom/memory/schema.rb,
core/lib/rom/model_builder.rb,
core/lib/rom/relation/name.rb,
core/lib/rom/relation/wrap.rb,
core/lib/rom/schema_plugin.rb,
core/lib/rom/commands/graph.rb,
core/lib/rom/mapper/builder.rb,
core/lib/rom/memory/dataset.rb,
core/lib/rom/memory/gateway.rb,
core/lib/rom/memory/storage.rb,
core/lib/rom/relation/graph.rb,
core/lib/rom/setup/finalize.rb,
core/lib/rom/association_set.rb,
core/lib/rom/commands/create.rb,
core/lib/rom/commands/delete.rb,
core/lib/rom/commands/update.rb,
core/lib/rom/mapper_compiler.rb,
core/lib/rom/mapper_registry.rb,
core/lib/rom/memory/commands.rb,
core/lib/rom/memory/relation.rb,
core/lib/rom/plugin_registry.rb,
core/lib/rom/relation/loaded.rb,
core/lib/rom/schema/inferrer.rb,
core/lib/rom/struct_compiler.rb,
core/lib/rom/command_compiler.rb,
core/lib/rom/command_registry.rb,
core/lib/rom/create_container.rb,
core/lib/rom/header/attribute.rb,
core/lib/rom/mapper/model_dsl.rb,
core/lib/rom/relation/curried.rb,
core/lib/rom/configuration_dsl.rb,
core/lib/rom/global/plugin_dsl.rb,
core/lib/rom/relation/combined.rb,
core/lib/rom/relation/commands.rb,
core/lib/rom/relation/view_dsl.rb,
core/lib/rom/relation_registry.rb,
core/lib/rom/support/inflector.rb,
core/lib/rom/commands/composite.rb,
core/lib/rom/enumerable_dataset.rb,
core/lib/rom/relation/composite.rb,
core/lib/rom/support/memoizable.rb,
core/lib/rom/processor/transproc.rb,
core/lib/rom/commands/lazy/create.rb,
core/lib/rom/commands/lazy/delete.rb,
core/lib/rom/commands/lazy/update.rb,
core/lib/rom/mapper/attribute_dsl.rb,
core/lib/rom/support/configurable.rb,
core/lib/rom/associations/abstract.rb,
core/lib/rom/support/notifications.rb,
core/lib/rom/memory/mapper_compiler.rb,
core/lib/rom/plugins/command/schema.rb,
core/lib/rom/associations/one_to_one.rb,
core/lib/rom/lint/enumerable_dataset.rb,
core/lib/rom/relation/materializable.rb,
core/lib/rom/schema/associations_dsl.rb,
core/lib/rom/setup/auto_registration.rb,
core/lib/rom/associations/many_to_one.rb,
core/lib/rom/associations/one_to_many.rb,
core/lib/rom/commands/class_interface.rb,
core/lib/rom/relation/class_interface.rb,
core/lib/rom/associations/many_to_many.rb,
core/lib/rom/configuration_dsl/command.rb,
core/lib/rom/plugins/schema/timestamps.rb,
core/lib/rom/configuration_dsl/relation.rb,
core/lib/rom/plugins/command/timestamps.rb,
core/lib/rom/configuration_dsl/mapper_dsl.rb,
core/lib/rom/configuration_dsl/command_dsl.rb,
core/lib/rom/commands/graph/class_interface.rb,
core/lib/rom/commands/graph/input_evaluator.rb,
core/lib/rom/memory/associations/one_to_one.rb,
core/lib/rom/associations/one_to_one_through.rb,
core/lib/rom/associations/through_identifier.rb,
core/lib/rom/memory/associations/many_to_one.rb,
core/lib/rom/memory/associations/one_to_many.rb,
core/lib/rom/setup/finalize/finalize_mappers.rb,
core/lib/rom/memory/associations/many_to_many.rb,
core/lib/rom/plugins/relation/instrumentation.rb,
core/lib/rom/plugins/relation/registry_reader.rb,
core/lib/rom/setup/finalize/finalize_commands.rb,
core/lib/rom/associations/definitions/abstract.rb,
core/lib/rom/setup/finalize/finalize_relations.rb,
core/lib/rom/associations/definitions/one_to_one.rb,
core/lib/rom/associations/definitions/many_to_one.rb,
core/lib/rom/associations/definitions/one_to_many.rb,
core/lib/rom/associations/definitions/many_to_many.rb,
core/lib/rom/setup/auto_registration_strategies/base.rb,
core/lib/rom/associations/definitions/one_to_one_through.rb,
core/lib/rom/setup/auto_registration_strategies/no_namespace.rb,
core/lib/rom/setup/auto_registration_strategies/with_namespace.rb,
core/lib/rom/setup/auto_registration_strategies/custom_namespace.rb,
changeset/lib/rom/changeset.rb,
changeset/lib/rom/changeset/pipe.rb,
changeset/lib/rom/changeset/create.rb,
changeset/lib/rom/changeset/delete.rb,
changeset/lib/rom/changeset/update.rb,
changeset/lib/rom/changeset/version.rb,
changeset/lib/rom/changeset/stateful.rb,
changeset/lib/rom/changeset/associated.rb,
changeset/lib/rom/changeset/pipe_registry.rb,
changeset/lib/rom/plugins/relation/changeset.rb,
changeset/lib/rom/changeset/extensions/relation.rb,
repository/lib/rom/repository.rb,
repository/lib/rom/repository/root.rb,
repository/lib/rom/repository/session.rb,
repository/lib/rom/repository/version.rb,
repository/lib/rom/repository/class_interface.rb,
repository/lib/rom/repository/relation_reader.rb

Overview

Constants and errors common in the whole library

Defined Under Namespace

Modules: ArrayDataset, Associations, AutoCurry, AutoRegistrationStrategies, Commands, Configurable, ConfigurationDSL, Core, DataProxy, EnumerableDataset, Global, Initializer, Lint, Memoizable, Memory, Notifications, Pipeline, Plugins, Types Classes: AdapterNotPresentError, AdapterPluginsContainer, AssociationSet, Attribute, AutoRegistration, Cache, Changeset, Command, CommandCompiler, CommandProxy, CommandRegistry, Configuration, Container, CreateContainer, ElementNotFoundError, Environment, Finalize, Gateway, Header, InlineCreateContainer, InvalidRelationName, Mapper, MapperCompiler, MapperRegistry, ModelBuilder, OpenStruct, Plugin, PluginRegistry, PluginsContainer, Processor, Registry, Relation, RelationRegistry, Repository, Schema, SchemaPlugin, Session, Setup, Struct, StructCompiler, Transaction, Transformer

Constant Summary collapse

AdapterLoadError =
Class.new(StandardError)
EnvAlreadyFinalizedError =
Class.new(StandardError)
RelationAlreadyDefinedError =
Class.new(StandardError)
MapperAlreadyDefinedError =
Class.new(StandardError)
MapperMisconfiguredError =
Class.new(StandardError)
NoRelationError =
Class.new(StandardError)
CommandError =
Class.new(StandardError)
KeyMissing =
Class.new(ROM::CommandError)
TupleCountMismatchError =
Class.new(CommandError)
UnknownPluginError =
Class.new(StandardError)
UnsupportedRelationError =
Class.new(StandardError)
MissingAdapterIdentifierError =
Class.new(StandardError)
AttributeAlreadyDefinedError =
Class.new(StandardError)
MapperMissingError =
Class.new(ElementNotFoundError)
CommandNotFoundError =
Class.new(ElementNotFoundError) do
  # @api private
  def set_message(key, registry)
    "There is no :#{key} command for :#{registry.relation_name} relation"
  end
end
MissingSchemaClassError =
Class.new(StandardError) do
  # @api private
  def initialize(klass)
    super("#{klass.inspect} relation is missing schema_class")
  end
end
MissingSchemaError =
Class.new(StandardError) do
  # @api private
  def initialize(klass)
    super("#{klass.inspect} relation is missing schema definition")
  end
end
DuplicateConfigurationError =
Class.new(StandardError)
DuplicateContainerError =
Class.new(StandardError)
InvalidOptionValueError =
Class.new(StandardError)
InvalidOptionKeyError =
Class.new(StandardError)
Inflector =
Dry::Inflector.new do |i|
  i.plural(/people\z/i, 'people')
end

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#adaptersHash<Symbol=>Module> (readonly) Originally defined in module Global

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.

An internal adapter identifier => adapter module map used by setup

Returns:

  • (Hash<Symbol=>Module>)

#plugin_registryHash (readonly) Originally defined in module Global

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.

An internal identifier => plugin map used by the setup

Returns:

  • (Hash)

Class Method Details

.container(*args, &block) ⇒ Object

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.



66
67
68
# File 'core/lib/rom/create_container.rb', line 66

def self.container(*args, &block)
  InlineCreateContainer.new(*args, &block).container
end

.plugins(*args, &block) ⇒ Object Originally defined in module Global

Global plugin setup DSL

Examples:

ROM.plugins do
  register :publisher, Plugin::Publisher, type: :command
end

.register_adapter(identifier, adapter) ⇒ self Originally defined in module Global

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.

Register adapter namespace under a specified identifier

Parameters:

  • identifier (Symbol)
  • adapter (Class, Module)

Returns:

  • (self)