Sha256: 8ada27216d4871ffb713cfb29bd9ec10c780717cfad4d61a6ab582ae6d670282

Contents?: true

Size: 346 Bytes

Versions: 4

Compression:

Stored size: 346 Bytes

Contents

module Tabit
  class Builder < Item
    def initialize(template, options, &block)
      @@template = template

      @children = []
      @options = options

      yield self if block_given?
    end

    def to_s
      template.content_tag(
        :ul,
        children.collect(&:to_s).join.html_safe,
        options
      )
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tabit-0.3.2 lib/tabit/builder.rb
tabit-0.3.1 lib/tabit/builder.rb
tabit-0.2.1 lib/tabit/builder.rb
tabit-0.2.0 lib/tabit/builder.rb