Class: Ariane::Render::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ariane/render/base.rb

Overview

Internal: Base renderer from which every renderer inherits.

Direct Known Subclasses

HTML

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Public: Initialize a Base renderer.

options - A Hash containing options for the renderer (default: {}):

:divider - The String divider used to separate crumbs
           (default: Base#divider).


14
15
16
17
18
# File 'lib/ariane/render/base.rb', line 14

def initialize(options={})
  @options = {
    divider: ' / '
  }.merge(options)
end

Instance Attribute Details

#optionsObject

Internal: Gets/Sets the Hash options.



7
8
9
# File 'lib/ariane/render/base.rb', line 7

def options
  @options
end

Instance Method Details

#dividerObject

Public: Returns the divider used to separate crumbs.

Returns the String ‘ / ’.



36
37
38
# File 'lib/ariane/render/base.rb', line 36

def divider
  ' / '
end

#render(crumbs) ⇒ Object

Internal: Renders the breadcrumbs.

This method MUST be overridden by any renderer inheriting from Base.

crumbs - An Array containing a list of Crumb objects composing the

breadcrumb.

Returns nothing. Raises RuntimeError everytime.



29
30
31
# File 'lib/ariane/render/base.rb', line 29

def render(crumbs)
  raise 'the render method is not implemented in your Ariane renderer'
end