Class: Bemer::Builders::Tree

Inherits:
Object
  • Object
show all
Extended by:
ActiveSupport::Autoload
Defined in:
lib/bemer/builders.rb,
lib/bemer/builders/tree.rb,
lib/bemer/builders/tree/element.rb

Defined Under Namespace

Classes: Element

Instance Method Summary collapse

Constructor Details

#initialize(tree) ⇒ Tree

Returns a new instance of Tree.



6
7
8
# File 'lib/bemer/builders/tree.rb', line 6

def initialize(tree)
  @tree = tree
end

Instance Method Details

#block(name = '', **options, &content) ⇒ Object



10
11
12
# File 'lib/bemer/builders/tree.rb', line 10

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

#elem(block = '', name = '', **options, &content) ⇒ Object



14
15
16
# File 'lib/bemer/builders/tree.rb', line 14

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

#text(content = nil, &callback) ⇒ Object



18
19
20
# File 'lib/bemer/builders/tree.rb', line 18

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