Class: BreadcrumbTrail::Builder Abstract

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

Overview

This class is abstract.

A Builder that is used by ActionController::HelperMethods#render_breadcrumbs. This should be subclassed and implemented.

Direct Known Subclasses

BlockBuilder, HTMLBuilder

Instance Method Summary collapse

Constructor Details

#initialize(context, breadcrumbs, options = {}, &block) ⇒ Builder

Initialize the builder.

Parameters:

  • context (ActionView::Base)

    The base of the view being rendered.

  • breadcrumbs (Array<Breadcrumb>)

    The breadcrumbs to render.

  • options (Hash) (defaults to: {})

    The options for the builder.


17
18
19
20
21
22
# File 'lib/breadcrumb_trail/builder.rb', line 17

def initialize(context, breadcrumbs, options = {}, &block)
  @context = context
  @breadcrumbs = breadcrumbs
  @options = options
  @block = block
end

Instance Method Details

#callString

Renders the breadcrumbs using the builder. However, since this is the base, it raises an error.

Returns:

  • (String)

Raises:

  • (NotImplementedError)

29
30
31
# File 'lib/breadcrumb_trail/builder.rb', line 29

def call
  raise NotImplementedError
end