Sha256: 10ae404e399e1705c2feb4c2ad487e5b40f10fb57df4e7fa69f1bceb7df02ec1
Contents?: true
Size: 688 Bytes
Versions: 2
Compression:
Stored size: 688 Bytes
Contents
# frozen_string_literal: true require_relative "../conversion_error" module ERBLint module Linters module ArgumentMappers module Helpers # provides helpers to identify and deal with ERB blocks. class ErbBlock class << self def raise_if_erb_block(attribute) raise ERBLint::Linters::ArgumentMappers::ConversionError, "Cannot convert attribute \"#{attribute.name}\" because its value contains an erb block" if any?(attribute) end def any?(attribute) attribute.value_node&.children&.any? { |n| n.try(:type) == :erb } end end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems