Sha256: 30d7a9149c9704f0a82714b0be7d2926da9147f7fbf322dc2170a9559a2c0829

Contents?: true

Size: 524 Bytes

Versions: 4

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true

module Bemer
  module Builders
    class Tree
      def initialize(tree)
        @tree = tree
      end

      def block(name = '', **options, &content)
        tree.add_node(name, options, &content)
      end

      def elem(block = '', name = '', **options, &content)
        tree.add_node(block, name, options, &content)
      end

      def text(content = nil, &callback)
        tree.add_text_node(content, &callback)
      end

      protected

      attr_reader :tree
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bemer-0.5.0 lib/bemer/builders/tree.rb
bemer-0.4.0 lib/bemer/builders/tree.rb
bemer-0.3.0 lib/bemer/builders/tree.rb
bemer-0.2.0 lib/bemer/builders/tree.rb