class Madness::Breadcrumbs

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

Attributes

path[R]

Public Class Methods

new(path) click to toggle source
# File lib/madness/breadcrumbs.rb, line 10
def initialize(path)
  @path = path
end

Public Instance Methods

Private Instance Methods

breadcrumbs_maker(partial_path) click to toggle source
get_breadcrumbs() click to toggle source
# File lib/madness/breadcrumbs.rb, line 20
def get_breadcrumbs
  home = OpenStruct.new({ label: "Home", href: '/' })
  result = breadcrumbs_maker(path).reverse.unshift home
  result.last.last = true
  result
end