Sha256: b15441bbfecddf7e21d7fe4c19361483a4f0e28ca01962e42ab4248e5e42f19e
Contents?: true
Size: 923 Bytes
Versions: 9
Compression:
Stored size: 923 Bytes
Contents
# frozen_string_literal: true module Dry module Schema # 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 class NamespacedRule # @api private attr_reader :rule # @api private attr_reader :namespace # @api private def initialize(namespace, rule) @namespace = namespace @rule = rule end # @api private def call(input) result = rule.call(input) Logic::Result.new(result.success?) { [:namespace, [namespace, result.to_ast]] } end # @api private def ast(input=Undefined) [:namespace, [namespace, rule.ast(input)]] end end end end
Version data entries
9 entries across 9 versions & 1 rubygems