class BreadcrumbTrail::BlockBuilder

Used along with a block given to the initializer, this renders the breadcrumbs.

Public Instance Methods

call() click to toggle source

Creates a buffer, and iterates over every breadcrumb, yielding the breadcrumb to the block given on initialization.

@return [String]

# File lib/breadcrumb_trail/builder.rb, line 43
def call
  buffer = ActiveSupport::SafeBuffer.new
  @breadcrumbs.each do |breadcrumb|
    buffer << @block.call(breadcrumb.computed(@context))
  end

  buffer
end