lib/dry/schema/messages/namespaced.rb in dry-schema-1.4.3 vs lib/dry/schema/messages/namespaced.rb in dry-schema-1.5.0

- old
+ new

@@ -22,11 +22,11 @@ # @api private def initialize(namespace, messages) @config = messages.config @namespace = namespace @messages = messages - @call_opts = { namespace: namespace }.freeze + @call_opts = {namespace: namespace}.freeze end # Get a message for the given key and its options # # @param [Symbol] key @@ -60,15 +60,25 @@ end # @api private def rule_lookup_paths(tokens) base_paths = messages.rule_lookup_paths(tokens) - base_paths.map { |key| key.gsub('dry_schema', "dry_schema.#{namespace}") } + base_paths + base_paths.map { |key| key.gsub("dry_schema", "dry_schema.#{namespace}") } + base_paths end # @api private def cache_key(predicate, options) messages.cache_key(predicate, options) + end + + # @api private + def interpolatable_data(key, options, **data) + messages.interpolatable_data(key, options, **data) + end + + # @api private + def interpolate(key, options, **data) + messages.interpolate(key, options, **data) end end end end end