@@ -146,7 +146,7 @@ def render_in(view_context, &block)
146146 value = if output_preamble . blank? && output_postamble . blank?
147147 rendered_template
148148 else
149- safe_output_preamble + rendered_template + safe_output_postamble
149+ __vc_safe_output_preamble + rendered_template + __vc_safe_output_postamble
150150 end
151151 end
152152
@@ -355,11 +355,7 @@ def __vc_content_set_by_with_content_defined?
355355 defined? ( @__vc_content_set_by_with_content )
356356 end
357357
358- def content_evaluated?
359- defined? ( @__vc_content_evaluated ) && @__vc_content_evaluated
360- end
361-
362- def maybe_escape_html ( text )
358+ def __vc_maybe_escape_html ( text )
363359 return text if @current_template && !@current_template . html?
364360 return text if text . blank?
365361
@@ -371,14 +367,14 @@ def maybe_escape_html(text)
371367 end
372368 end
373369
374- def safe_output_preamble
375- maybe_escape_html ( output_preamble ) do
370+ def __vc_safe_output_preamble
371+ __vc_maybe_escape_html ( output_preamble ) do
376372 Kernel . warn ( "WARNING: The #{ self . class } component was provided an HTML-unsafe preamble. The preamble will be automatically escaped, but you may want to investigate." )
377373 end
378374 end
379375
380- def safe_output_postamble
381- maybe_escape_html ( output_postamble ) do
376+ def __vc_safe_output_postamble
377+ __vc_maybe_escape_html ( output_postamble ) do
382378 Kernel . warn ( "WARNING: The #{ self . class } component was provided an HTML-unsafe postamble. The postamble will be automatically escaped, but you may want to investigate." )
383379 end
384380 end
@@ -556,7 +552,7 @@ def render_template_for(requested_details)
556552 child . virtual_path = child . name &.underscore
557553
558554 # Set collection parameter to the extended component
559- child . with_collection_parameter provided_collection_parameter
555+ child . with_collection_parameter ( __vc_provided_collection_parameter )
560556
561557 if instance_methods ( false ) . include? ( :render_template_for )
562558 vc_ancestor_calls = defined? ( @__vc_ancestor_calls ) ? @__vc_ancestor_calls . dup : [ ]
@@ -591,8 +587,8 @@ def __vc_compiler
591587 #
592588 # @param parameter [Symbol] The parameter name used when rendering elements of a collection.
593589 def with_collection_parameter ( parameter )
594- @provided_collection_parameter = parameter
595- @initialize_parameters = nil
590+ @__vc_provided_collection_parameter = parameter
591+ @__vc_initialize_parameters = nil
596592 end
597593
598594 # Strips trailing whitespace from templates before compiling them.
@@ -622,10 +618,10 @@ def strip_trailing_whitespace?
622618 # rendering is optional.
623619 # @private
624620 def __vc_validate_collection_parameter! ( validate_default : false )
625- parameter = validate_default ? __vc_collection_parameter : provided_collection_parameter
621+ parameter = validate_default ? __vc_collection_parameter : __vc_provided_collection_parameter
626622
627623 return unless parameter
628- return if __vc_initialize_parameter_names . include? ( parameter ) || splatted_keyword_argument_present ?
624+ return if __vc_initialize_parameter_names . include? ( parameter ) || __vc_splatted_keyword_argument_present ?
629625
630626 raise MissingCollectionArgumentError . new ( name , parameter )
631627 end
@@ -642,7 +638,7 @@ def __vc_validate_initialization_parameters!
642638
643639 # @private
644640 def __vc_collection_parameter
645- @provided_collection_parameter ||= name && name . demodulize . underscore . chomp ( "_component" ) . to_sym
641+ @__vc_provided_collection_parameter ||= name && name . demodulize . underscore . chomp ( "_component" ) . to_sym
646642 end
647643
648644 # @private
@@ -667,25 +663,25 @@ def __vc_iteration_argument_present?
667663
668664 private
669665
670- def splatted_keyword_argument_present ?
671- initialize_parameters . flatten . include? ( :keyrest )
666+ def __vc_splatted_keyword_argument_present ?
667+ __vc_initialize_parameters . flatten . include? ( :keyrest )
672668 end
673669
674670 def __vc_initialize_parameter_names
675671 @__vc_initialize_parameter_names ||=
676672 if respond_to? ( :attribute_names )
677673 attribute_names . map ( &:to_sym )
678674 else
679- initialize_parameters . map ( &:last )
675+ __vc_initialize_parameters . map ( &:last )
680676 end
681677 end
682678
683- def initialize_parameters
684- @initialize_parameters ||= instance_method ( :initialize ) . parameters
679+ def __vc_initialize_parameters
680+ @__vc_initialize_parameters ||= instance_method ( :initialize ) . parameters
685681 end
686682
687- def provided_collection_parameter
688- @provided_collection_parameter ||= nil
683+ def __vc_provided_collection_parameter
684+ @__vc_provided_collection_parameter ||= nil
689685 end
690686 end
691687
0 commit comments