method
_dasherize
v5.1.7 -
Show latest stable
- Class:
ActiveSupport::XmlMini
_dasherize(key)private
No documentation available.
# File activesupport/lib/active_support/xml_mini.rb, line 164
def _dasherize(key)
# $2 must be a non-greedy regex for this to work
left, middle, right = /\A(_*)(.*?)(_*)\Z/.match(key.strip)[1, 3]
"#{left}#{middle.tr('_ ', '--')}#{right}"
end