Skip to content

Instantly share code, notes, and snippets.

@fabiokung
Created March 2, 2009 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save fabiokung/72852 to your computer and use it in GitHub Desktop.
Save fabiokung/72852 to your computer and use it in GitHub Desktop.
def method_missing(name, *args)
puts "<#{name}>#{args[0]}"
yield if block_given?
puts "</#{name}>"
end
html do
body do
h1 "My internal DSL"
div do
span "HTML generation engine in 4 lines"
ul do
li "take a look at Markaby"
li "at least once"
li "for some more ideas"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment