Sha256: ba508f9040445979e823deb88581c0f22068e61593cd7ed876cffeff1d2b729b

Contents?: true

Size: 524 Bytes

Versions: 4

Compression:

Stored size: 524 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

4 entries across 4 versions & 1 rubygems

Version Path
twitter_bootstrap_builder-0.0.6 lib/twitter_bootstrap_builder/builders/tab_builder.rb
twitter_bootstrap_builder-0.0.5 lib/twitter_bootstrap_builder/builders/tab_builder.rb
twitter_bootstrap_builder-0.0.4 lib/twitter_bootstrap_builder/builders/tab_builder.rb
twitter_bootstrap_builder-0.0.3 lib/twitter_bootstrap_builder/builders/tab_builder.rb