Class: Dry::Validation::Macro
- Defined in:
- lib/dry/validation/macro.rb
Overview
A wrapper for macro validation blocks
Instance Attribute Summary collapse
- #args ⇒ Array readonly
- #block ⇒ Proc readonly private
- #name ⇒ Symbol readonly
Instance Method Summary collapse
- #extract_block_options(options) ⇒ Object private
- #with(args) ⇒ Object private
Instance Attribute Details
#args ⇒ Array (readonly)
20 |
# File 'lib/dry/validation/macro.rb', line 20 option :args |
#block ⇒ Proc (readonly)
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.
25 |
# File 'lib/dry/validation/macro.rb', line 25 option :block |
#name ⇒ Symbol (readonly)
15 |
# File 'lib/dry/validation/macro.rb', line 15 param :name |
Instance Method Details
#extract_block_options(options) ⇒ 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.
33 34 35 |
# File 'lib/dry/validation/macro.rb', line 33 def () .transform_values { [_1] } end |
#with(args) ⇒ 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.
28 29 30 |
# File 'lib/dry/validation/macro.rb', line 28 def with(args) self.class.new(name, args: args, block: block) end |