Class: TwitterBootstrapBuilder::Builders::NavBarBuilder

Inherits:
Base
  • Object
show all
Defined in:
lib/twitter_bootstrap_builder/builders/nav_bar_builder.rb

Instance Attribute Summary

Attributes inherited from Base

#block, #options, #template

Instance Method Summary collapse

Methods inherited from Base

#html_safe, #initialize

Constructor Details

This class inherits a constructor from TwitterBootstrapBuilder::Builders::Base

Instance Method Details

#brand(title, url) ⇒ Object



11
12
13
# File 'lib/twitter_bootstrap_builder/builders/nav_bar_builder.rb', line 11

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

#container(&block) ⇒ Object



15
16
17
# File 'lib/twitter_bootstrap_builder/builders/nav_bar_builder.rb', line 15

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

#container_right(&block) ⇒ Object



19
20
21
# File 'lib/twitter_bootstrap_builder/builders/nav_bar_builder.rb', line 19

def container_right(&block)
  NavContainerBuilder.new(template, align: :right, &block).html_safe
end

#to_sObject



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

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