I think this should get Yard to do the right thing:
# @!parse AWESOME = "cold Coke"
# @!parse LAME = "warm Coke"
This could be expanded upon using Yard's macro attachments, if you have bar
everywhere in your code. However, the macro behaviour does not seem to like constants, or allow for string processing that your DSL might do with contents (e.g. converting to upper case). I could get basic behaviour, that might be adaptable for your needs, as follows:
# @!visibility private
# @!macro [attach] bar
# @!method $1()
# @return [String] always "$2"
def self.bar(name, value)
const_set(name, value)
end
bar :awesome, "cold Coke"
bar :lame, "warm Coke"
Which ends up looking a little like this:
Instance Method Summary
(String) awesome
- Always "cold Coke".
- Always "cold Coke".
(String) lame
- Always "warm Coke".
- Always "warm Coke".