Class: BreadcrumbsOnRails::Breadcrumbs::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/breadcrumbs_on_rails/breadcrumbs.rb

Overview

Represents a navigation element in the breadcrumb collection.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, path = nil, options = {}) ⇒ Element

Initializes the Element with given parameters.

Parameters:

  • name (String) —

    The element/link name.

  • path (String) (defaults to: nil) —

    The element/link URL.

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

    The element/link options.



121
122
123
124
125
# File 'lib/breadcrumbs_on_rails/breadcrumbs.rb', line 121

def initialize(name, path = nil, options = {})
  self.name     = name
  self.path     = path
  self.options  = options
end

Instance Attribute Details

#name ⇒ String

Returns The element/link name.

Returns:

  • (String) —

    The element/link name.



108
109
110
# File 'lib/breadcrumbs_on_rails/breadcrumbs.rb', line 108

def name
  @name
end

#options ⇒ Hash

Returns The element/link options.

Returns:

  • (Hash) —

    The element/link options.



112
113
114
# File 'lib/breadcrumbs_on_rails/breadcrumbs.rb', line 112

def options
  @options
end

#path ⇒ String

Returns The element/link URL.

Returns:

  • (String) —

    The element/link URL.



110
111
112
# File 'lib/breadcrumbs_on_rails/breadcrumbs.rb', line 110

def path
  @path
end