Class: BreadcrumbTrail::BlockBuilder

Inherits:
Builder
  • Object
show all
Defined in:
lib/breadcrumb_trail/builder.rb

Overview

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

Instance Method Summary collapse

Methods inherited from Builder

#initialize

Constructor Details

This class inherits a constructor from BreadcrumbTrail::Builder

Instance Method Details

#callString

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

Returns:

  • (String)

43
44
45
46
47
48
49
50
# 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