| Module | Buildable |
| In: |
lib/more/facets/buildable.rb
|
Buildable is mixin variation of BuildingBlock.
require 'facets/buildable'
require 'xmlmarkup' # hypothetical library
module XMLMarkup
include Buildable
alias :build :element
end
doc = XMLMarkup.build do
html do
head do
title "Test"
end
body do
i "Hello"
br
text "Test"
text "Hey"
end
end
end
produces
<html><head><title>Test</title><body><i>Hello</i><br />TestHey</body></html>
This is based on BuildingBlock. Refer to it for more information.