Class: Breadcrumbs::Template
- Inherits:
-
Object
- Object
- Breadcrumbs::Template
- Defined in:
- lib/breadcrumbs/template.rb
Instance Method Summary collapse
-
#initialize(root) ⇒ Template
constructor
A new instance of Template.
- #load ⇒ Object
Constructor Details
#initialize(root) ⇒ Template
Returns a new instance of Template.
3 4 5 |
# File 'lib/breadcrumbs/template.rb', line 3 def initialize(root) @root = root end |
Instance Method Details
#load ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/breadcrumbs/template.rb', line 7 def load custom = File.join(@root, "_includes", "breadcrumbs.html") if File.exist?(custom) File.read(custom) else File.read(File.join(__dir__, "template.html")) end end |