Skip to content

Instantly share code, notes, and snippets.

@matid
Created September 8, 2008 11:17
Show Gist options
  • Save matid/9418 to your computer and use it in GitHub Desktop.
Save matid/9418 to your computer and use it in GitHub Desktop.
def define(label, &block)
if block_given?
definition = capture(&block)
else
definition = label.first.last
label = label.first.first
end
content = markaby do
dt label.t
dd { definition }
end.to_s unless definition.blank?
concat(content.to_s, block.binding) if block_given?
content
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment