Class: Madness::Breadcrumbs

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

Overview

Handle breadcumbs generation by converting a path to an array of links

Defined Under Namespace

Classes: Breadcrumb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Breadcrumbs

Returns a new instance of Breadcrumbs.



11
12
13
# File 'lib/madness/breadcrumbs.rb', line 11

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/madness/breadcrumbs.rb', line 9

def path
  @path
end

Instance Method Details



15
16
17
# File 'lib/madness/breadcrumbs.rb', line 15

def links
  path == '' ? [] : breadcrumbs
end