class Dry::Schema::NamespacedRule
A special rule type that is configured under a specified namespace
This is used internally to create rules that can be properly handled by the message compiler in situations where a schema reuses another schema but it is configured to use a message namespace
@api private
Attributes
namespace[R]
@api private
rule[R]
@api private
Public Class Methods
new(namespace, rule)
click to toggle source
@api private
# File lib/dry/schema/namespaced_rule.rb, line 20 def initialize(namespace, rule) @namespace = namespace @rule = rule end
Public Instance Methods
ast(input = Undefined)
click to toggle source
@api private
# File lib/dry/schema/namespaced_rule.rb, line 32 def ast(input = Undefined) [:namespace, [namespace, rule.ast(input)]] end
Also aliased as: to_ast
call(input)
click to toggle source
@api private
# File lib/dry/schema/namespaced_rule.rb, line 26 def call(input) result = rule.call(input) Logic::Result.new(result.success?) { [:namespace, [namespace, result.to_ast]] } end