senro_usecaser 0.2.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/CHANGELOG.md +23 -0
- data/README.md +850 -0
- data/examples/namespace_demo.rb +50 -15
- data/examples/order_system.rb +222 -34
- data/examples/sig/namespace_demo.rbs +35 -10
- data/examples/sig/order_system.rbs +196 -20
- data/lib/senro_usecaser/base.rb +387 -86
- data/lib/senro_usecaser/depends_on.rb +257 -0
- data/lib/senro_usecaser/hook.rb +28 -82
- data/lib/senro_usecaser/provider.rb +1 -1
- data/lib/senro_usecaser/retry_configuration.rb +131 -0
- data/lib/senro_usecaser/retry_context.rb +133 -0
- data/lib/senro_usecaser/version.rb +1 -1
- data/lib/senro_usecaser.rb +3 -0
- data/sig/generated/senro_usecaser/base.rbs +179 -37
- data/sig/generated/senro_usecaser/depends_on.rbs +197 -0
- data/sig/generated/senro_usecaser/hook.rbs +23 -35
- data/sig/generated/senro_usecaser/provider.rbs +1 -1
- data/sig/generated/senro_usecaser/retry_configuration.rbs +90 -0
- data/sig/generated/senro_usecaser/retry_context.rbs +101 -0
- data/sig/overrides.rbs +1 -2
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a40e2440b8f5f624de415bc556c1fb3aed16cf6f5afdef5a6c1b36d8b71242f
|
|
4
|
+
data.tar.gz: ffd39400b4f7ebb5e89cd6e27aff1f41e5cfc4410584170498dd3f0a821b7821
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 26c5ba7d471feb89eb69353f16ae5a86ba6da67bf0fc057982a8ad48f8022f5a88ccc55ee566fa243e74a13957e7a3e824525985acd3975a82ae935e60853ef8
|
|
7
|
+
data.tar.gz: 4e27567ba9ef646b358f781c136e9840fcc57d644ea93d844925cde8d975f62665ec91694cdc6f447d2c020995373b3951e667ced56345ee3c6820cfb08e8f54
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.0] - 2026-01-31
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Runtime type validation for input**
|
|
13
|
+
- `input` now accepts Module(s) for interface-based validation
|
|
14
|
+
- Single module: `input HasUserId` - validates that input's class includes the module
|
|
15
|
+
- Multiple modules: `input HasUserId, HasEmail` - validates that input's class includes all modules
|
|
16
|
+
- Class validation remains supported for backwards compatibility
|
|
17
|
+
- **Runtime type validation for output**
|
|
18
|
+
- When `output` is declared with a Class, the success result's value is validated
|
|
19
|
+
- Raises `TypeError` if the output value is not an instance of the declared class
|
|
20
|
+
- Hash schema (`output({ key: Type })`) skips validation for backwards compatibility
|
|
21
|
+
- **New class methods**
|
|
22
|
+
- `input_types` - Returns an array of declared input types (Module/Class)
|
|
23
|
+
- `input_class` - Backwards compatible method, returns Class if specified or first type
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Type validation errors raise exceptions with `.call` and return `Result.failure` with `.call!`
|
|
28
|
+
- Input validation: `ArgumentError`
|
|
29
|
+
- Output validation: `TypeError`
|
|
30
|
+
|
|
8
31
|
## [0.2.0] - 2026-01-31
|
|
9
32
|
|
|
10
33
|
### Added
|