Created
September 8, 2008 11:17
-
-
Save matid/9418 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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