Module: Dry::Validation::Macros
- Defined in:
- lib/dry/validation/macros.rb
Overview
API for registering and accessing Rule macros
Defined Under Namespace
Modules: Registrar Classes: Container
Class Method Summary collapse
-
.[](name) ⇒ Proc
Return a registered macro.
- .container ⇒ Object private
-
.register(name, *args, &block) ⇒ Macros
Register a global macro.
Class Method Details
.[](name) ⇒ Proc
Return a registered macro
75 76 77 |
# File 'lib/dry/validation/macros.rb', line 75 def self.[](name) container[name] end |
.container ⇒ 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.
92 93 94 |
# File 'lib/dry/validation/macros.rb', line 92 def self.container @container ||= Container.new end |
.register(name, *args, &block) ⇒ Macros
Register a global macro
86 87 88 89 |
# File 'lib/dry/validation/macros.rb', line 86 def self.register(name, *args, &block) container.register(name, *args, &block) self end |