lib/yard/lib/yard/templates/template.rb
# Runs a template on +sects+ using extra options. This method should
# not be called directly. Instead, call the class method {ClassMethods#run}
#
# @param [Hash, nil] opts any extra options to apply to sections
# @param [Section, Array] sects a section list of sections to render
# @param [Fixnum] start_at the index in the section list to start from
# @param [Boolean] break_first if true, renders only the first section
# @yield [opts] calls for the subsections to be rendered
# @yieldparam [Hash] opts any extra options to yield
# @return [String] the rendered sections joined together
Runs a template on +sects+ using extra options. This method should
not be called directly. Instead, call the class method {ClassMethods#run}
Runs a template on + sects + using extra options . This method should not be called directly . Instead call the class method { ClassMethods#run }
def run(opts = nil, sects = sections, start_at = 0, break_first = false, &block)
        out = ""
        return out if sects.nil?
        sects = sects[start_at..-1] if start_at > 0
        sects = Section.new(nil, sects) unless sects.is_a?(Section)
        add_options(opts) do
          sects.each do |s|
            self.section = s
            subsection_index = 0
            value = render_section(section) do |*args|
              value = with_section do
                run(args.first, section, subsection_index, true, &block)
              end
              subsection_index += 1
              value
            end
            out << (value || "")
            break if break_first
          end
        end
        out
      end
def run ( opts = nil , sects = sections , start_at = 0 , break_first = false , & block ) out = "" return out if sects . nil? sects = sects [ start_at .. - 1 ] if start_at > 0 sects = Section . new ( nil , sects ) unless sects . is_a? ( Section ) add_options ( opts ) do sects . each do | s | self . section = s subsection_index = 0 value = render_section ( section ) do | * args | value = with_section do run ( args . first , section , subsection_index , true , & block ) end subsection_index += 1 value end out << ( value || "" ) break if break_first end end out end
Runs a template on +sects+ using extra options.
Runs a template on + sects + using extra options .
the rendered sections joined together
the rendered sections joined together
String
opts
sects
sections
start_at
break_first
block
opts any extra options to yield
opts any extra options to yield
]
calls for the subsections to be rendered
calls for the subsections to be rendered