class Dry::Schema::Messages::YAML
def evaluation_context(key, options)
- Api: - private
def evaluation_context(key, options) cache.fetch_or_store(get(key, options).fetch(:text)) do |input| tokens = input.scan(TOKEN_REGEXP).flatten(1).map(&:to_sym).to_set text = input.gsub("%", "#") # rubocop:disable Security/Eval # rubocop:disable Style/DocumentDynamicEvalDefinition evaluator = eval(<<~RUBY, EMPTY_CONTEXT, __FILE__, __LINE__ + 1) -> (#{tokens.map { |token| "#{token}:" }.join(", ")}) { "#{text}" } RUBY # rubocop:enable Style/DocumentDynamicEvalDefinition # rubocop:enable Security/Eval { tokens: tokens, evaluator: evaluator } end end