Module: ROM

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

Overview

Constants and errors common in the whole library

Defined Under Namespace

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

Constant Summary collapse

VERSION =
"6.0.0"
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

.camelize(name) ⇒ Object Originally defined in module ZeitwerkCompatibility

.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.


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

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)