Sha256: 06df58273f163a2b459f578cfca1f71f66ff024dbb6897939cb654093f2483eb

Contents?: true

Size: 502 Bytes

Versions: 2

Compression:

Stored size: 502 Bytes

Contents

module TwitterBootstrapBuilder
  module Builders
    class TabBuilder < Base

      def initialize(*args, &block)
        super
        @tab = Tab.new
      end

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

      def content_for(text, id=nil, &block)
        id = text.parameterize('_') unless id
        @tab.nav.append NavTab.new(text, "##{id}")
        @tab.content.append id, template.capture(self, &block) if block_given?
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
twitter_bootstrap_builder-0.0.8 lib/twitter_bootstrap_builder/builders/tab_builder.rb
twitter_bootstrap_builder-0.0.7 lib/twitter_bootstrap_builder/builders/tab_builder.rb