Module: Yes::Core

Defined in:
lib/yes/core.rb,
lib/yes/core.rb,
lib/yes/core/error.rb,
lib/yes/core/event.rb,
lib/yes/core/types.rb,
lib/yes/core/command.rb,
lib/yes/core/railtie.rb,
lib/yes/core/version.rb,
lib/yes/core/aggregate.rb,
lib/yes/core/serializer.rb,
lib/yes/core/middlewares.rb,
lib/yes/core/type_lookup.rb,
lib/yes/core/commands/bus.rb,
lib/yes/core/configuration.rb,
lib/yes/core/subscriptions.rb,
lib/yes/core/commands/group.rb,
lib/yes/core/data_decryptor.rb,
lib/yes/core/data_encryptor.rb,
lib/yes/core/error_messages.rb,
lib/yes/core/commands/helper.rb,
lib/yes/core/utils/hash_utils.rb,
lib/yes/core/commands/notifier.rb,
lib/yes/core/commands/response.rb,
lib/yes/core/read_model/filter.rb,
lib/yes/core/commands/processor.rb,
lib/yes/core/commands/validator.rb,
lib/yes/core/payload_store/base.rb,
lib/yes/core/read_model/builder.rb,
lib/yes/core/utils/caller_utils.rb,
lib/yes/core/aggregate/draftable.rb,
lib/yes/core/encryption_metadata.rb,
lib/yes/core/transaction_details.rb,
lib/yes/core/utils/command_utils.rb,
lib/yes/core/authentication_error.rb,
lib/yes/core/event_class_resolver.rb,
lib/yes/core/payload_store/errors.rb,
lib/yes/core/payload_store/lookup.rb,
lib/yes/core/utils/error_notifier.rb,
lib/yes/core/middlewares/encryptor.rb,
lib/yes/core/middlewares/timestamp.rb,
lib/yes/core/process_managers/base.rb,
lib/yes/core/process_managers/state.rb,
lib/yes/core/commands/group_response.rb,
lib/yes/core/open_telemetry/otl_span.rb,
lib/yes/core/aggregate/has_authorizer.rb,
lib/yes/core/aggregate/has_read_model.rb,
lib/yes/core/open_telemetry/trackable.rb,
lib/yes/core/read_model/event_handler.rb,
lib/yes/core/test_support/jwt_helpers.rb,
lib/yes/core/test_support/test_helper.rb,
lib/yes/core/models/application_record.rb,
lib/yes/core/utils/aggregate_shortcuts.rb,
lib/yes/core/utils/event_name_resolver.rb,
lib/yes/core/utils/exponential_retrier.rb,
lib/yes/core/aggregate/dsl/command_data.rb,
lib/yes/core/commands/stateless/handler.rb,
lib/yes/core/commands/stateless/subject.rb,
lib/yes/core/test_support/event_helpers.rb,
lib/yes/core/commands/stateless/response.rb,
lib/yes/core/aggregate/dsl/attribute_data.rb,
lib/yes/core/jobs/read_model_recovery_job.rb,
lib/yes/core/aggregate/dsl/command_definer.rb,
lib/yes/core/command_handling/guard_runner.rb,
lib/yes/core/aggregate/read_model_rebuilder.rb,
lib/yes/core/command_handling/payload_proxy.rb,
lib/yes/core/command_handling/state_updater.rb,
lib/yes/core/aggregate/dsl/attribute_definer.rb,
lib/yes/core/aggregate/dsl/constant_resolver.rb,
lib/yes/core/process_managers/command_runner.rb,
lib/yes/core/process_managers/service_client.rb,
lib/yes/core/read_model/filter_query_builder.rb,
lib/yes/core/authorization/command_authorizer.rb,
lib/yes/core/command_handling/command_handler.rb,
lib/yes/core/command_handling/event_publisher.rb,
lib/yes/core/command_handling/guard_evaluator.rb,
lib/yes/core/commands/stateless/group_handler.rb,
lib/yes/core/command_handling/command_executor.rb,
lib/yes/core/commands/stateless/group_response.rb,
lib/yes/core/test_support/subscriptions_helper.rb,
lib/yes/core/aggregate/dsl/class_resolvers/base.rb,
lib/yes/core/command_handling/aggregate_tracker.rb,
lib/yes/core/commands/stateless/handler_helpers.rb,
lib/yes/core/aggregate/dsl/class_name_convention.rb,
lib/yes/core/authorization/read_model_authorizer.rb,
lib/yes/core/command_handling/read_model_updater.rb,
lib/yes/core/middlewares/with_indifferent_access.rb,
lib/yes/core/authorization/cerbos_client_provider.rb,
lib/yes/core/authorization/read_models_authorizer.rb,
lib/yes/core/process_managers/access_token_client.rb,
lib/yes/core/aggregate/shared_read_model_rebuilder.rb,
lib/yes/core/authorization/read_request_authorizer.rb,
lib/yes/core/aggregate/dsl/command_shortcut_expander.rb,
lib/yes/core/authorization/command_cerbos_authorizer.rb,
lib/yes/core/generators/read_models/update_generator.rb,
lib/yes/core/test_support/aggregate/command_test_dsl.rb,
lib/yes/core/aggregate/dsl/class_resolvers/authorizer.rb,
lib/yes/core/aggregate/dsl/class_resolvers/read_model.rb,
lib/yes/core/aggregate/dsl/attribute_definers/standard.rb,
lib/yes/core/aggregate/dsl/attribute_definers/aggregate.rb,
lib/yes/core/aggregate/dsl/class_resolvers/command/base.rb,
lib/yes/core/aggregate/dsl/method_definers/command/base.rb,
lib/yes/core/command_handling/read_model_revision_guard.rb,
lib/yes/core/aggregate/dsl/class_resolvers/command/event.rb,
lib/yes/core/active_job_serializers/dry_struct_serializer.rb,
lib/yes/core/aggregate/dsl/method_definers/attribute/base.rb,
lib/yes/core/authorization/read_request_cerbos_authorizer.rb,
lib/yes/core/command_handling/read_model_recovery_service.rb,
lib/yes/core/aggregate/dsl/class_resolvers/command/command.rb,
lib/yes/core/aggregate/dsl/method_definers/command/command.rb,
lib/yes/core/active_job_serializers/command_group_serializer.rb,
lib/yes/core/aggregate/dsl/class_resolvers/read_model_filter.rb,
lib/yes/core/aggregate/dsl/class_resolvers/command/authorizer.rb,
lib/yes/core/aggregate/dsl/method_definers/attribute/accessor.rb,
lib/yes/core/aggregate/dsl/method_definers/command/can_command.rb,
lib/yes/core/aggregate/dsl/class_resolvers/command/state_updater.rb,
lib/yes/core/aggregate/dsl/class_resolvers/read_model_serializer.rb,
lib/yes/core/aggregate/dsl/class_resolvers/command/guard_evaluator.rb,
lib/yes/core/aggregate/dsl/class_resolvers/command/cerbos_authorizer.rb,
lib/yes/core/aggregate/dsl/class_resolvers/command/simple_authorizer.rb,
lib/yes/core/aggregate/dsl/class_resolvers/command/authorizer_factory.rb,
lib/yes/core/aggregate/dsl/method_definers/attribute/aggregate_accessor.rb,
lib/yes/core/generators/read_models/add_pending_update_tracking_generator.rb

Defined Under Namespace

Modules: ActiveJobSerializers, Authorization, CommandHandling, CommandHelpers, CommandNotifiers, Commands, Generators, Jobs, Middlewares, OpenTelemetry, PayloadStore, ProcessManagers, ReadModel, Stateless, TestSupport, TransactionDetailsTypes, Types, Utils Classes: Aggregate, ApplicationRecord, AuthenticationError, Command, Configuration, DataDecryptor, DataEncryptor, EncryptionMetadata, Error, ErrorMessages, Event, EventClassResolver, Railtie, Serializer, Subscriptions, TransactionDetails, TypeLookup

Constant Summary collapse

CommandBus =

Commands

Commands::Bus
CommandProcessor =
Commands::Processor
CommandResponse =
Commands::Response
CommandGroupResponse =
Commands::GroupResponse
CommandGroup =
Commands::Group
CommandHelper =
Commands::Helper
CommandNotifier =
Commands::Notifier
CommandValidator =
Commands::Validator
CommandAuthorizer =

Authorization

Authorization::CommandAuthorizer
CommandCerbosAuthorizer =
Authorization::CommandCerbosAuthorizer
ReadRequestAuthorizer =
Authorization::ReadRequestAuthorizer
ReadRequestCerbosAuthorizer =
Authorization::ReadRequestCerbosAuthorizer
ReadModelAuthorizer =
Authorization::ReadModelAuthorizer
ReadModelsAuthorizer =
Authorization::ReadModelsAuthorizer
ReadModelFilter =

Read Model

ReadModel::Filter
ReadModelBuilder =
ReadModel::Builder
FilterQueryBuilder =
ReadModel::FilterQueryBuilder
EventHandler =
ReadModel::EventHandler
HashUtils =

Utils

Utils::HashUtils
ErrorNotifier =
Utils::ErrorNotifier
VERSION =
'1.1.0'

Class Method Summary collapse

Class Method Details

.configurationYes::Core::Configuration

Returns the singleton instance of the configuration

Examples:

config = Yes::Core.configuration
config.register_command_class(:user, :create, CreateUserCommand)

Returns:



10
11
12
# File 'lib/yes/core/configuration.rb', line 10

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|Yes::Core::Configuration| ... } ⇒ Object

Configures Yes::Core

Examples:

Yes::Core.configure do |config|
  config.aggregate_shortcuts = true
end

Yields:



20
21
22
# File 'lib/yes/core/configuration.rb', line 20

def self.configure
  yield configuration
end

.loaderObject



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/yes/core.rb', line 15

def loader
  @loader ||= begin
    loader = Zeitwerk::Loader.new
    loader.tag = 'yes-core'
    loader.push_dir(File.expand_path('..', __dir__))
    loader.ignore("#{__dir__}/core/version.rb")
    loader.ignore("#{__dir__}/core/test_support")
    loader.ignore("#{__dir__}/core/test_support.rb")
    loader.collapse("#{__dir__}/core/models")
    loader.setup
    loader
  end
end