A lot of Rails tag helpers (e.g. content_tag etc.) use a hash option parameter named class to specify a HTML class.
content_tag(:div, content_tag(:p, "Hello world!"), class: "strong")
For new code I would like to use keyword arguments, but is that possible when one of them is a language keyword?
e.g. for a hypothetical link_tag.
def link_tag(url, class: nil)
html = ''
html << '<a href="' << url << '"'
html << ' class="' << class << '"' if class
...
def link_tag(url, opts={})
html = ''
html << '<a href="' << url << '"'
html << ' class="' << opts[:class] << '"' if opts[:class]
...