Class: CMDx::Settings
- Inherits:
-
Object
- Object
- CMDx::Settings
- Defined in:
- lib/cmdx/settings.rb
Overview
Value object encapsulating all per-task configuration. Registries are deep-duped on inheritance; scalar settings delegate to a parent Settings or to the global Configuration rather than eagerly copying values.
Instance Attribute Summary collapse
-
#attributes ⇒ AttributeRegistry
Returns the attribute registry for task parameters.
-
#backtrace ⇒ Boolean
True if backtraces should be logged.
-
#backtrace_cleaner ⇒ Proc?
The backtrace cleaner proc.
-
#breakpoints ⇒ Array<String>?
Per-task breakpoints override.
-
#callbacks ⇒ CallbackRegistry
Returns the callback registry for task lifecycle hooks.
-
#coercions ⇒ CoercionRegistry
Returns the coercion registry for type conversions.
-
#deprecate ⇒ Symbol, ...
Deprecation behavior.
-
#exception_handler ⇒ Proc?
The exception handler proc.
-
#log_formatter ⇒ Proc?
Per-task log formatter override.
-
#log_level ⇒ Integer?
Per-task log level override.
-
#logger ⇒ Logger
The logger instance.
-
#middlewares ⇒ MiddlewareRegistry
Returns the middleware registry for task execution.
-
#retries ⇒ Integer?
Number of retries on failure.
-
#retry_jitter ⇒ Numeric, ...
Jitter between retries.
-
#retry_on ⇒ Array<Class>, ...
Exception classes to retry on.
-
#returns ⇒ Array<Symbol>
Returns the expected return keys after execution.
-
#rollback_on ⇒ Array<String>
Statuses that trigger rollback.
-
#tags ⇒ Array<Symbol>
Returns the tags for task categorization.
-
#task_breakpoints ⇒ Array<String>
Default task breakpoint statuses.
-
#validators ⇒ ValidatorRegistry
Returns the validator registry for attribute validation.
-
#workflow_breakpoints ⇒ Array<String>
Default workflow breakpoint statuses.
Instance Method Summary collapse
-
#initialize(parent: nil, **overrides) ⇒ Settings
constructor
Creates a new Settings instance, inheriting registries from a parent Settings or the global Configuration.
Constructor Details
#initialize(parent: nil, **overrides) ⇒ Settings
Creates a new Settings instance, inheriting registries from a parent Settings or the global Configuration. Scalar settings are resolved lazily via delegation rather than eagerly copied.
179 180 181 182 183 184 185 186 |
# File 'lib/cmdx/settings.rb', line 179 def initialize(parent: nil, **overrides) @parent = parent init_registries init_collections overrides.each { |key, value| public_send(:"#{key}=", value) } end |
Instance Attribute Details
#attributes ⇒ AttributeRegistry
Returns the attribute registry for task parameters.
68 69 70 |
# File 'lib/cmdx/settings.rb', line 68 def attributes @attributes end |
#backtrace ⇒ Boolean
Returns true if backtraces should be logged.
114 |
# File 'lib/cmdx/settings.rb', line 114 delegate_to_configuration :backtrace |
#backtrace_cleaner ⇒ Proc?
Returns The backtrace cleaner proc.
130 |
# File 'lib/cmdx/settings.rb', line 130 delegate_to_parent :backtrace_cleaner, with_fallback: true |
#breakpoints ⇒ Array<String>?
Returns Per-task breakpoints override.
134 |
# File 'lib/cmdx/settings.rb', line 134 delegate_to_parent :breakpoints |
#callbacks ⇒ CallbackRegistry
Returns the callback registry for task lifecycle hooks.
75 76 77 |
# File 'lib/cmdx/settings.rb', line 75 def callbacks @callbacks end |
#coercions ⇒ CoercionRegistry
Returns the coercion registry for type conversions.
82 83 84 |
# File 'lib/cmdx/settings.rb', line 82 def coercions @coercions end |
#deprecate ⇒ Symbol, ...
Returns Deprecation behavior.
138 |
# File 'lib/cmdx/settings.rb', line 138 delegate_to_parent :deprecate |
#exception_handler ⇒ Proc?
Returns The exception handler proc.
142 |
# File 'lib/cmdx/settings.rb', line 142 delegate_to_parent :exception_handler, with_fallback: true |
#log_formatter ⇒ Proc?
Returns Per-task log formatter override.
150 |
# File 'lib/cmdx/settings.rb', line 150 delegate_to_parent :log_formatter |
#log_level ⇒ Integer?
Returns Per-task log level override.
154 |
# File 'lib/cmdx/settings.rb', line 154 delegate_to_parent :log_level |
#logger ⇒ Logger
Returns The logger instance.
146 |
# File 'lib/cmdx/settings.rb', line 146 delegate_to_parent :logger, with_fallback: true |
#middlewares ⇒ MiddlewareRegistry
Returns the middleware registry for task execution.
89 90 91 |
# File 'lib/cmdx/settings.rb', line 89 def middlewares @middlewares end |
#retries ⇒ Integer?
Returns Number of retries on failure.
158 |
# File 'lib/cmdx/settings.rb', line 158 delegate_to_parent :retries |
#retry_jitter ⇒ Numeric, ...
Returns Jitter between retries.
162 |
# File 'lib/cmdx/settings.rb', line 162 delegate_to_parent :retry_jitter |
#retry_on ⇒ Array<Class>, ...
Returns Exception classes to retry on.
166 |
# File 'lib/cmdx/settings.rb', line 166 delegate_to_parent :retry_on |
#returns ⇒ Array<Symbol>
Returns the expected return keys after execution.
103 104 105 |
# File 'lib/cmdx/settings.rb', line 103 def returns @returns end |
#rollback_on ⇒ Array<String>
Returns Statuses that trigger rollback.
118 |
# File 'lib/cmdx/settings.rb', line 118 delegate_to_configuration :rollback_on |
#tags ⇒ Array<Symbol>
Returns the tags for task categorization.
110 111 112 |
# File 'lib/cmdx/settings.rb', line 110 def @tags end |
#task_breakpoints ⇒ Array<String>
Returns Default task breakpoint statuses.
122 |
# File 'lib/cmdx/settings.rb', line 122 delegate_to_configuration :task_breakpoints |
#validators ⇒ ValidatorRegistry
Returns the validator registry for attribute validation.
96 97 98 |
# File 'lib/cmdx/settings.rb', line 96 def validators @validators end |
#workflow_breakpoints ⇒ Array<String>
Returns Default workflow breakpoint statuses.
126 |
# File 'lib/cmdx/settings.rb', line 126 delegate_to_configuration :workflow_breakpoints |