domainic-attributer 0.2.0 → 0.2.2
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/CHANGELOG.md +10 -3
- data/README.md +3 -4
- data/lib/domainic/attributer/attribute/coercer.rb +1 -1
- data/lib/domainic/attributer/attribute/signature.rb +1 -1
- data/lib/domainic/attributer/attribute/validator.rb +1 -1
- data/lib/domainic/attributer/attribute.rb +1 -1
- data/lib/domainic/attributer/attribute_set.rb +2 -2
- data/sig/domainic/attributer/attribute/signature.rbs +8 -0
- data/sig/domainic/attributer/attribute.rbs +14 -0
- data/sig/domainic/attributer/class_methods.rbs +66 -12
- data/sig/domainic/attributer/dsl/attribute_builder/option_parser.rbs +0 -6
- data/sig/domainic/attributer/dsl/attribute_builder.rbs +6 -0
- data/sig/domainic/attributer/errors/error.rbs +2 -0
- metadata +9 -14
- data/sig/domainic/attributer/dsl.rbs +0 -1
- data/sig/domainic-attributer.rbs +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5980e97a335d1914c6d55ee523bda15837a086342132e610686c2af7d5c44ddf
|
4
|
+
data.tar.gz: c36ee1d48066201f8496d751a6938502ee5c54179c3bb067c87a1912c3650e1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e2785664cb883f45c612f77fbc1c2ae2b24270ff6c2f8b7770542e0ecf16cdca3fc9ebcb107473ac383de7135761d5f4131940607521942ee09c52463519723
|
7
|
+
data.tar.gz: a46df3371b3824e14d4bb0b60f77e94c243286667c813166d3f6f7c3c73d3982f5b16121619154f3d724f79a011a445d2f6cba33a33d4597648d2070e8d40229
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog], and this project adheres to [Break Ve
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [v0.2.2] - 2025-06-09
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
* Migrated from the mono-repo
|
14
|
+
|
9
15
|
## [v0.2.0] - 2025-01-01
|
10
16
|
|
11
17
|
### Added
|
@@ -40,6 +46,7 @@ The format is based on [Keep a Changelog], and this project adheres to [Break Ve
|
|
40
46
|
|
41
47
|
<!-- versions -->
|
42
48
|
|
43
|
-
[Unreleased]: https://github.com/domainic/
|
44
|
-
[v0.2.
|
45
|
-
[v0.
|
49
|
+
[Unreleased]: https://github.com/domainic/attributer/compare/0.2.2...HEAD
|
50
|
+
[v0.2.2]: https://github.com/domainic/attributer/compare/0.2.0...0.2.2
|
51
|
+
[v0.2.0]: https://github.com/domainic/attributer/compare/0.1.0...0.2.0
|
52
|
+
[v0.1.0]: https://github.com/domainic/attributer/compare/e9be85cf821d36d572f9c4601b84ec0f5a40f083...0.1.0
|
data/README.md
CHANGED
@@ -2,8 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://rubygems.org/gems/domainic-attributer)
|
4
4
|
[](./LICENSE)
|
5
|
-
[](https://rubydoc.info/gems/domainic-attributer/0.
|
6
|
-
[](https://github.com/domainic/domainic/issues?q=state%3Aopen%20label%3Adomainic-attributer%20)
|
5
|
+
[](https://rubydoc.info/gems/domainic-attributer/0.2.2)
|
7
6
|
|
8
7
|
Domainic::Attributer is a powerful toolkit that brings clarity and safety to your Ruby class attributes.
|
9
8
|
Ever wished your class attributes could:
|
@@ -69,14 +68,14 @@ For detailed usage instructions and examples, see [USAGE.md](./docs/USAGE.md).
|
|
69
68
|
## Contributing
|
70
69
|
|
71
70
|
We welcome contributions! Please see our
|
72
|
-
[Contributing Guidelines](
|
71
|
+
[Contributing Guidelines](./docs/CONTRIBUTING) for:
|
73
72
|
|
74
73
|
* Development setup and workflow
|
75
74
|
* Code style and documentation standards
|
76
75
|
* Testing requirements
|
77
76
|
* Pull request process
|
78
77
|
|
79
|
-
Before contributing, please review our [Code of Conduct](
|
78
|
+
Before contributing, please review our [Code of Conduct](./docs/CODE_OF_CONDUCT).
|
80
79
|
|
81
80
|
## License
|
82
81
|
|
@@ -146,7 +146,7 @@ module Domainic
|
|
146
146
|
if handler.is_a?(Proc)
|
147
147
|
instance.instance_exec(value, &handler)
|
148
148
|
elsif handler.respond_to?(:===)
|
149
|
-
handler === value
|
149
|
+
handler === value
|
150
150
|
else
|
151
151
|
# We should never get here because we validate the handlers in the initializer
|
152
152
|
raise TypeError, "`#{attribute_method_name}`: invalid validator: #{handler.inspect}"
|
@@ -232,7 +232,7 @@ module Domainic
|
|
232
232
|
default: @default,
|
233
233
|
description: @description,
|
234
234
|
name: @name,
|
235
|
-
validators: @validator.instance_variable_get(:@handlers)
|
235
|
+
validators: @validator.instance_variable_get(:@handlers),
|
236
236
|
}.merge(signature.send(:to_options)) #: initialize_options
|
237
237
|
end
|
238
238
|
|
@@ -112,7 +112,7 @@ module Domainic
|
|
112
112
|
duped.instance_variable_set(:@base, new_base)
|
113
113
|
duped.instance_variable_set(
|
114
114
|
:@lookup,
|
115
|
-
@lookup.transform_values { |attribute| attribute.dup_with_base(new_base) }
|
115
|
+
@lookup.transform_values { |attribute| attribute.dup_with_base(new_base) },
|
116
116
|
)
|
117
117
|
end
|
118
118
|
end
|
@@ -201,7 +201,7 @@ module Domainic
|
|
201
201
|
else
|
202
202
|
(attribute.default? ? 1 : 0)
|
203
203
|
end,
|
204
|
-
attribute.signature.position
|
204
|
+
attribute.signature.position,
|
205
205
|
]
|
206
206
|
end.to_h
|
207
207
|
end
|
@@ -103,6 +103,14 @@ module Domainic
|
|
103
103
|
#
|
104
104
|
# @raise [ArgumentError] if the configuration is invalid
|
105
105
|
# @return [Signature] the new Signature instance
|
106
|
+
# Attribute attribute,
|
107
|
+
# ?nilable: bool,
|
108
|
+
# ?position: Integer?,
|
109
|
+
# ?read: visibility_symbol,
|
110
|
+
# ?required: bool,
|
111
|
+
# type: type_symbol,
|
112
|
+
# ?write: visibility_symbol
|
113
|
+
# ) -> void
|
106
114
|
def initialize: (Attribute attribute, type: type_symbol, ?nilable: bool, ?position: Integer?, ?read: visibility_symbol, ?required: bool, ?write: visibility_symbol) -> void
|
107
115
|
|
108
116
|
# Check if this signature is for an argument attribute
|
@@ -69,6 +69,20 @@ module Domainic
|
|
69
69
|
#
|
70
70
|
# @raise [ArgumentError] if the configuration is invalid
|
71
71
|
# @return [Attribute] the new Attribute instance
|
72
|
+
# __todo__ base,
|
73
|
+
# ?callbacks: Array[Callback::handler] | Callback::handler,
|
74
|
+
# ?coercers: Array[Coercer::handler] | Coercer::handler,
|
75
|
+
# ?default: untyped,
|
76
|
+
# ?description: String?,
|
77
|
+
# name: String | Symbol,
|
78
|
+
# ?nilable: bool,
|
79
|
+
# ?position: Integer?,
|
80
|
+
# ?read: Signature::visibility_symbol,
|
81
|
+
# ?required: bool,
|
82
|
+
# type: Signature::type_symbol,
|
83
|
+
# ?validators: Array[Validator::handler] | Validator::handler,
|
84
|
+
# ?write: Signature::visibility_symbol
|
85
|
+
# ) -> void
|
72
86
|
def initialize: (__todo__ base, name: String | Symbol, type: Signature::type_symbol, ?callbacks: Array[Callback::handler] | Callback::handler, ?coercers: Array[Coercer::handler] | Coercer::handler, ?default: untyped, ?description: String?, ?nilable: bool, ?position: Integer?, ?read: Signature::visibility_symbol, ?required: bool, ?validators: Array[Validator::handler] | Validator::handler, ?write: Signature::visibility_symbol) -> void
|
73
87
|
|
74
88
|
# Apply a value to the attribute on an instance
|
@@ -66,10 +66,8 @@ module Domainic
|
|
66
66
|
# @param type_validator [Proc, Object, nil] optional validation handler for type checking
|
67
67
|
# @param options [Hash{Symbol => Object}] additional configuration options
|
68
68
|
# @option options [Array<Proc>, Proc] :callbacks handlers for attribute change events (priority over
|
69
|
-
# :callback, :on_change)
|
70
69
|
# @option options [Array<Proc>, Proc] :callback alias for :callbacks
|
71
70
|
# @option options [Array<Proc, Symbol>, Proc, Symbol] :coerce handlers for value coercion (priority over
|
72
|
-
# :coercers, :coerce_with)
|
73
71
|
# @option options [Array<Proc, Symbol>, Proc, Symbol] :coercers alias for :coerce
|
74
72
|
# @option options [Array<Proc, Symbol>, Proc, Symbol] :coerce_with alias for :coerce
|
75
73
|
# @option options [Object] :default the default value (priority over :default_generator, :default_value)
|
@@ -78,7 +76,6 @@ module Domainic
|
|
78
76
|
# @option options [String] :desc short description (overridden by :description)
|
79
77
|
# @option options [String] :description description text
|
80
78
|
# @option options [Boolean] :non_nil require non-nil values (priority over :non_null, :non_nullable, :not_nil,
|
81
|
-
# :not_nilable, :not_null, :not_nullable)
|
82
79
|
# @option options [Boolean] :non_null alias for :non_nil
|
83
80
|
# @option options [Boolean] :non_nullable alias for :non_nil
|
84
81
|
# @option options [Boolean] :not_nil alias for :non_nil
|
@@ -90,20 +87,50 @@ module Domainic
|
|
90
87
|
# @option options [Boolean] :optional whether attribute is optional (overridden by :required)
|
91
88
|
# @option options [Integer] :position specify order position
|
92
89
|
# @option options [Symbol] :read read visibility (:public, :protected, :private) (priority over :read_access,
|
93
|
-
# :reader)
|
94
90
|
# @option options [Symbol] :read_access alias for :read
|
95
91
|
# @option options [Symbol] :reader alias for :read
|
96
92
|
# @option options [Boolean] :required whether attribute is required
|
97
93
|
# @option options [Array<Object>, Object] :validate validators for the attribute (priority over
|
98
|
-
# :validate_with, :validators)
|
99
94
|
# @option options [Array<Object>, Object] :validate_with alias for :validate
|
100
95
|
# @option options [Array<Object>, Object] :validators alias for :validate
|
101
96
|
# @option options [Symbol] :write_access write visibility (:public, :protected, :private) (priority over
|
102
|
-
# :writer)
|
103
97
|
# @option options [Symbol] :writer alias for :write_access
|
104
98
|
#
|
105
99
|
# @yield [DSL::AttributeBuilder] configuration block for additional attribute settings
|
106
100
|
# @return [void]
|
101
|
+
# String | Symbol attribute_name,
|
102
|
+
# ?Attribute::Validator::handler type_validator,
|
103
|
+
# ?callbacks: Array[Attribute::Callback::handler] | Attribute::Callback::handler,
|
104
|
+
# ?callback: Array[Attribute::Callback::handler] | Attribute::Callback::handler,
|
105
|
+
# ?coerce: Array[Attribute::Coercer::handler] | Attribute::Coercer::handler,
|
106
|
+
# ?coercers: Array[Attribute::Coercer::handler],
|
107
|
+
# ?coerce_with: [Attribute::Coercer::handler] | Attribute::Coercer::handler,
|
108
|
+
# ?default: untyped,
|
109
|
+
# ?default_generator: untyped,
|
110
|
+
# ?default_value: untyped,
|
111
|
+
# ?desc: String?,
|
112
|
+
# ?description: String,
|
113
|
+
# ?non_nil: bool,
|
114
|
+
# ?non_null: bool,
|
115
|
+
# ?non_nullable: bool,
|
116
|
+
# ?not_nil: bool,
|
117
|
+
# ?not_nilable: bool,
|
118
|
+
# ?not_null: bool,
|
119
|
+
# ?not_nullable: bool,
|
120
|
+
# ?null: bool,
|
121
|
+
# ?on_change: Array[Attribute::Callback::handler] | Attribute::Callback::handler,
|
122
|
+
# ?optional: bool,
|
123
|
+
# ?position: Integer?,
|
124
|
+
# ?read: Attribute::Signature::visibility_symbol,
|
125
|
+
# ?read_access: Attribute::Signature::visibility_symbol,
|
126
|
+
# ?reader: Attribute::Signature::visibility_symbol,
|
127
|
+
# ?required: bool,
|
128
|
+
# ?validate: Array[Attribute::Validator::handler] | Attribute::Validator::handler,
|
129
|
+
# ?validate_with: Array[Attribute::Validator::handler] | Attribute::Validator::handler,
|
130
|
+
# ?validators: Array[Attribute::Validator::handler] | Attribute::Validator::handler,
|
131
|
+
# ?write_access: Attribute::Signature::visibility_symbol,
|
132
|
+
# ?writer: Attribute::Signature::visibility_symbol,
|
133
|
+
# ) ?{ (?) [self: DSL::AttributeBuilder] -> void } -> void
|
107
134
|
def argument: (String | Symbol attribute_name, ?Attribute::Validator::handler type_validator, ?callbacks: Array[Attribute::Callback::handler] | Attribute::Callback::handler, ?callback: Array[Attribute::Callback::handler] | Attribute::Callback::handler, ?coerce: Array[Attribute::Coercer::handler] | Attribute::Coercer::handler, ?coercers: Array[Attribute::Coercer::handler], ?coerce_with: [ Attribute::Coercer::handler ] | Attribute::Coercer::handler, ?default: untyped, ?default_generator: untyped, ?default_value: untyped, ?desc: String?, ?description: String, ?non_nil: bool, ?non_null: bool, ?non_nullable: bool, ?not_nil: bool, ?not_nilable: bool, ?not_null: bool, ?not_nullable: bool, ?null: bool, ?on_change: Array[Attribute::Callback::handler] | Attribute::Callback::handler, ?optional: bool, ?position: Integer?, ?read: Attribute::Signature::visibility_symbol, ?read_access: Attribute::Signature::visibility_symbol, ?reader: Attribute::Signature::visibility_symbol, ?required: bool, ?validate: Array[Attribute::Validator::handler] | Attribute::Validator::handler, ?validate_with: Array[Attribute::Validator::handler] | Attribute::Validator::handler, ?validators: Array[Attribute::Validator::handler] | Attribute::Validator::handler, ?write_access: Attribute::Signature::visibility_symbol, ?writer: Attribute::Signature::visibility_symbol) ?{ (?) [self: DSL::AttributeBuilder] -> void } -> void
|
108
135
|
|
109
136
|
# Define a named option attribute
|
@@ -144,10 +171,8 @@ module Domainic
|
|
144
171
|
# @param type_validator [Proc, Object, nil] optional validation handler for type checking
|
145
172
|
# @param options [Hash{Symbol => Object}] additional configuration options
|
146
173
|
# @option options [Array<Proc>, Proc] :callbacks handlers for attribute change events (priority over
|
147
|
-
# :callback, :on_change)
|
148
174
|
# @option options [Array<Proc>, Proc] :callback alias for :callbacks
|
149
175
|
# @option options [Array<Proc, Symbol>, Proc, Symbol] :coerce handlers for value coercion (priority over
|
150
|
-
# :coercers, :coerce_with)
|
151
176
|
# @option options [Array<Proc, Symbol>, Proc, Symbol] :coercers alias for :coerce
|
152
177
|
# @option options [Array<Proc, Symbol>, Proc, Symbol] :coerce_with alias for :coerce
|
153
178
|
# @option options [Object] :default the default value (priority over :default_generator, :default_value)
|
@@ -156,7 +181,6 @@ module Domainic
|
|
156
181
|
# @option options [String] :desc short description (overridden by :description)
|
157
182
|
# @option options [String] :description description text
|
158
183
|
# @option options [Boolean] :non_nil require non-nil values (priority over :non_null, :non_nullable, :not_nil,
|
159
|
-
# :not_nilable, :not_null, :not_nullable)
|
160
184
|
# @option options [Boolean] :non_null alias for :non_nil
|
161
185
|
# @option options [Boolean] :non_nullable alias for :non_nil
|
162
186
|
# @option options [Boolean] :not_nil alias for :non_nil
|
@@ -168,20 +192,50 @@ module Domainic
|
|
168
192
|
# @option options [Boolean] :optional whether attribute is optional (overridden by :required)
|
169
193
|
# @option options [Integer] :position specify order position
|
170
194
|
# @option options [Symbol] :read read visibility (:public, :protected, :private) (priority over :read_access,
|
171
|
-
# :reader)
|
172
195
|
# @option options [Symbol] :read_access alias for :read
|
173
196
|
# @option options [Symbol] :reader alias for :read
|
174
197
|
# @option options [Boolean] :required whether attribute is required
|
175
198
|
# @option options [Array<Object>, Object] :validate validators for the attribute (priority over
|
176
|
-
# :validate_with, :validators)
|
177
199
|
# @option options [Array<Object>, Object] :validate_with alias for :validate
|
178
200
|
# @option options [Array<Object>, Object] :validators alias for :validate
|
179
201
|
# @option options [Symbol] :write_access write visibility (:public, :protected, :private) (priority over
|
180
|
-
# :writer)
|
181
202
|
# @option options [Symbol] :writer alias for :write_access
|
182
203
|
#
|
183
204
|
# @yield [DSL::AttributeBuilder] configuration block for additional attribute settings
|
184
205
|
# @return [void]
|
206
|
+
# String | Symbol attribute_name,
|
207
|
+
# ?Attribute::Validator::handler type_validator,
|
208
|
+
# ?callbacks: Array[Attribute::Callback::handler] | Attribute::Callback::handler,
|
209
|
+
# ?callback: Array[Attribute::Callback::handler] | Attribute::Callback::handler,
|
210
|
+
# ?coerce: Array[Attribute::Coercer::handler] | Attribute::Coercer::handler,
|
211
|
+
# ?coercers: Array[Attribute::Coercer::handler],
|
212
|
+
# ?coerce_with: [Attribute::Coercer::handler] | Attribute::Coercer::handler,
|
213
|
+
# ?default: untyped,
|
214
|
+
# ?default_generator: untyped,
|
215
|
+
# ?default_value: untyped,
|
216
|
+
# ?desc: String?,
|
217
|
+
# ?description: String,
|
218
|
+
# ?non_nil: bool,
|
219
|
+
# ?non_null: bool,
|
220
|
+
# ?non_nullable: bool,
|
221
|
+
# ?not_nil: bool,
|
222
|
+
# ?not_nilable: bool,
|
223
|
+
# ?not_null: bool,
|
224
|
+
# ?not_nullable: bool,
|
225
|
+
# ?null: bool,
|
226
|
+
# ?on_change: Array[Attribute::Callback::handler] | Attribute::Callback::handler,
|
227
|
+
# ?optional: bool,
|
228
|
+
# ?position: Integer?,
|
229
|
+
# ?read: Attribute::Signature::visibility_symbol,
|
230
|
+
# ?read_access: Attribute::Signature::visibility_symbol,
|
231
|
+
# ?reader: Attribute::Signature::visibility_symbol,
|
232
|
+
# ?required: bool,
|
233
|
+
# ?validate: Array[Attribute::Validator::handler] | Attribute::Validator::handler,
|
234
|
+
# ?validate_with: Array[Attribute::Validator::handler] | Attribute::Validator::handler,
|
235
|
+
# ?validators: Array[Attribute::Validator::handler] | Attribute::Validator::handler,
|
236
|
+
# ?write_access: Attribute::Signature::visibility_symbol,
|
237
|
+
# ?writer: Attribute::Signature::visibility_symbol,
|
238
|
+
# ) ?{ (?) [self: DSL::AttributeBuilder] -> void } -> void
|
185
239
|
def option: (String | Symbol attribute_name, ?Attribute::Validator::handler type_validator, ?callbacks: Array[Attribute::Callback::handler] | Attribute::Callback::handler, ?callback: Array[Attribute::Callback::handler] | Attribute::Callback::handler, ?coerce: Array[Attribute::Coercer::handler] | Attribute::Coercer::handler, ?coercers: Array[Attribute::Coercer::handler], ?coerce_with: [ Attribute::Coercer::handler ] | Attribute::Coercer::handler, ?default: untyped, ?default_generator: untyped, ?default_value: untyped, ?desc: String?, ?description: String, ?non_nil: bool, ?non_null: bool, ?non_nullable: bool, ?not_nil: bool, ?not_nilable: bool, ?not_null: bool, ?not_nullable: bool, ?null: bool, ?on_change: Array[Attribute::Callback::handler] | Attribute::Callback::handler, ?optional: bool, ?position: Integer?, ?read: Attribute::Signature::visibility_symbol, ?read_access: Attribute::Signature::visibility_symbol, ?reader: Attribute::Signature::visibility_symbol, ?required: bool, ?validate: Array[Attribute::Validator::handler] | Attribute::Validator::handler, ?validate_with: Array[Attribute::Validator::handler] | Attribute::Validator::handler, ?validators: Array[Attribute::Validator::handler] | Attribute::Validator::handler, ?write_access: Attribute::Signature::visibility_symbol, ?writer: Attribute::Signature::visibility_symbol) ?{ (?) [self: DSL::AttributeBuilder] -> void } -> void
|
186
240
|
|
187
241
|
private
|
@@ -66,10 +66,8 @@ module Domainic
|
|
66
66
|
# @param options [Hash{String, Symbol => Object}] the options to parse
|
67
67
|
#
|
68
68
|
# @option options [Array<Proc>, Proc] :callbacks handlers for attribute change events (priority over
|
69
|
-
# :callback, :on_change)
|
70
69
|
# @option options [Array<Proc>, Proc] :callback alias for :callbacks
|
71
70
|
# @option options [Array<Proc, Symbol>, Proc, Symbol] :coerce handlers for value coercion (priority over
|
72
|
-
# :coercers, :coerce_with)
|
73
71
|
# @option options [Array<Proc, Symbol>, Proc, Symbol] :coercers alias for :coerce
|
74
72
|
# @option options [Array<Proc, Symbol>, Proc, Symbol] :coerce_with alias for :coerce
|
75
73
|
# @option options [Object] :default the default value (priority over :default_generator, :default_value)
|
@@ -78,7 +76,6 @@ module Domainic
|
|
78
76
|
# @option options [String] :desc short description (overridden by :description)
|
79
77
|
# @option options [String] :description description text
|
80
78
|
# @option options [Boolean] :non_nil require non-nil values (priority over :non_null, :non_nullable, :not_nil,
|
81
|
-
# :not_nilable, :not_null, :not_nullable)
|
82
79
|
# @option options [Boolean] :non_null alias for :non_nil
|
83
80
|
# @option options [Boolean] :non_nullable alias for :non_nil
|
84
81
|
# @option options [Boolean] :not_nil alias for :non_nil
|
@@ -90,16 +87,13 @@ module Domainic
|
|
90
87
|
# @option options [Boolean] :optional whether attribute is optional (overridden by :required)
|
91
88
|
# @option options [Integer] :position specify order position
|
92
89
|
# @option options [Symbol] :read read visibility (:public, :protected, :private) (priority over :read_access,
|
93
|
-
# :reader)
|
94
90
|
# @option options [Symbol] :read_access alias for :read
|
95
91
|
# @option options [Symbol] :reader alias for :read
|
96
92
|
# @option options [Boolean] :required whether attribute is required
|
97
93
|
# @option options [Array<Object>, Object] :validate validators for the attribute (priority over
|
98
|
-
# :validate_with, :validators)
|
99
94
|
# @option options [Array<Object>, Object] :validate_with alias for :validate
|
100
95
|
# @option options [Array<Object>, Object] :validators alias for :validate
|
101
96
|
# @option options [Symbol] :write_access write visibility (:public, :protected, :private) (priority over
|
102
|
-
# :writer)
|
103
97
|
# @option options [Symbol] :writer alias for :write_access
|
104
98
|
#
|
105
99
|
# @return [OptionParser] the new OptionParser instance
|
@@ -22,6 +22,12 @@ module Domainic
|
|
22
22
|
# {OptionParser#initialize} for details
|
23
23
|
#
|
24
24
|
# @return [AttributeBuilder] the new AttributeBuilder instance
|
25
|
+
# __todo__ base,
|
26
|
+
# String | Symbol attribute_name,
|
27
|
+
# String | Symbol attribute_type,
|
28
|
+
# ?Attribute::Validator::handler? type_validator,
|
29
|
+
# OptionParser::options options,
|
30
|
+
# ) ? { (?) [self: AttributeBuilder] -> void } -> void
|
25
31
|
def initialize: (__todo__ base, String | Symbol attribute_name, String | Symbol attribute_type, ?Attribute::Validator::handler? type_validator, OptionParser::options options) ?{ (?) [self: AttributeBuilder] -> void } -> void
|
26
32
|
|
27
33
|
# Build and finalize the {Attribute}
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domainic-attributer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Allen
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Your domain objects deserve better than plain old attributes. Level up
|
14
13
|
your DDD game with powerful, configurable, and well-documented class attributes
|
@@ -46,7 +45,6 @@ files:
|
|
46
45
|
- lib/domainic/attributer/errors/validation_execution_error.rb
|
47
46
|
- lib/domainic/attributer/instance_methods.rb
|
48
47
|
- lib/domainic/attributer/undefined.rb
|
49
|
-
- sig/domainic-attributer.rbs
|
50
48
|
- sig/domainic/attributer.rbs
|
51
49
|
- sig/domainic/attributer/attribute.rbs
|
52
50
|
- sig/domainic/attributer/attribute/callback.rbs
|
@@ -56,7 +54,6 @@ files:
|
|
56
54
|
- sig/domainic/attributer/attribute/validator.rbs
|
57
55
|
- sig/domainic/attributer/attribute_set.rbs
|
58
56
|
- sig/domainic/attributer/class_methods.rbs
|
59
|
-
- sig/domainic/attributer/dsl.rbs
|
60
57
|
- sig/domainic/attributer/dsl/attribute_builder.rbs
|
61
58
|
- sig/domainic/attributer/dsl/attribute_builder/option_parser.rbs
|
62
59
|
- sig/domainic/attributer/dsl/initializer.rbs
|
@@ -69,17 +66,16 @@ files:
|
|
69
66
|
- sig/domainic/attributer/instance_methods.rbs
|
70
67
|
- sig/domainic/attributer/undefined.rbs
|
71
68
|
- sig/manifest.yaml
|
72
|
-
homepage: https://
|
69
|
+
homepage: https://domainic.org
|
73
70
|
licenses:
|
74
71
|
- MIT
|
75
72
|
metadata:
|
76
|
-
bug_tracker_uri: https://github.com/domainic/
|
77
|
-
changelog_uri: https://github.com/domainic/
|
78
|
-
documentation_uri: https://rubydoc.info/gems/domainic-attributer/0.2.
|
79
|
-
homepage_uri: https://
|
73
|
+
bug_tracker_uri: https://github.com/domainic/attributer/issues
|
74
|
+
changelog_uri: https://github.com/domainic/attributer/releases/tag/0.2.2
|
75
|
+
documentation_uri: https://rubydoc.info/gems/domainic-attributer/0.2.2
|
76
|
+
homepage_uri: https://domainic.org
|
80
77
|
rubygems_mfa_required: 'true'
|
81
|
-
source_code_uri: https://github.com/domainic/
|
82
|
-
post_install_message:
|
78
|
+
source_code_uri: https://github.com/domainic/attributer/tree/0.2.2
|
83
79
|
rdoc_options: []
|
84
80
|
require_paths:
|
85
81
|
- lib
|
@@ -94,8 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
90
|
- !ruby/object:Gem::Version
|
95
91
|
version: '0'
|
96
92
|
requirements: []
|
97
|
-
rubygems_version: 3.
|
98
|
-
signing_key:
|
93
|
+
rubygems_version: 3.6.8
|
99
94
|
specification_version: 4
|
100
95
|
summary: A toolkit for creating self-documenting, type-safe class attributes with
|
101
96
|
built-in validation, coercion, and default values.
|
@@ -1 +0,0 @@
|
|
1
|
-
|
data/sig/domainic-attributer.rbs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
|