Class: ScaffoldMarkup::Builders::NavBarBuilder

Inherits:
BaseBuilder
  • Object
show all
Defined in:
lib/scaffold_markup/builders/nav_bar_builder.rb

Instance Attribute Summary

Attributes inherited from BaseBuilder

#block, #template, #url

Instance Method Summary collapse

Methods inherited from BaseBuilder

#html_safe, #initialize

Constructor Details

This class inherits a constructor from ScaffoldMarkup::Builders::BaseBuilder

Instance Method Details

#brand(text, url) ⇒ Object



12
13
14
# File 'lib/scaffold_markup/builders/nav_bar_builder.rb', line 12

def brand(text, url)
  Brand.new(text, url).html_safe
end

#container(&block) ⇒ Object



16
17
18
# File 'lib/scaffold_markup/builders/nav_bar_builder.rb', line 16

def container(&block)
  NavContainerBuilder.new(template, &block).html_safe
end


20
21
22
# File 'lib/scaffold_markup/builders/nav_bar_builder.rb', line 20

def link(text, url)
  Link.new(text, url).html_safe
end

#to_sObject



5
6
7
8
9
10
# File 'lib/scaffold_markup/builders/nav_bar_builder.rb', line 5

def to_s
  _self = self
  NavBar.top do
    append _self.template.capture(_self, &_self.block)
  end.to_s
end