Class: ScaffoldMarkup::Builders::NavContainerBuilder

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

Instance Attribute Summary

Attributes inherited from BaseBuilder

#block, #template, #url

Instance Method Summary collapse

Methods inherited from BaseBuilder

#html_safe

Constructor Details

#initialize(*args, &block) ⇒ NavContainerBuilder

Returns a new instance of NavContainerBuilder.



5
6
7
8
# File 'lib/scaffold_markup/builders/nav_container_builder.rb', line 5

def initialize(*args, &block)
  super(*args, &block)
  @container = NavContainer.new {}
end

Instance Method Details



15
16
17
# File 'lib/scaffold_markup/builders/nav_container_builder.rb', line 15

def link(text, url)
  @container.append Link.new(text, url)
end

#pull_rightObject



19
20
21
# File 'lib/scaffold_markup/builders/nav_container_builder.rb', line 19

def pull_right
  @container.pull_right
end

#to_sObject



10
11
12
13
# File 'lib/scaffold_markup/builders/nav_container_builder.rb', line 10

def to_s
  template.capture(self, &block)
  @container.to_s
end