Method: Mail::Utilities#underscoreize
- Defined in:
- lib/mail/utilities.rb
#underscoreize(str) ⇒ Object
Swaps out all hyphens (-) for underscores (_) good for stringing to symbols a field name.
Example:
string = :resent_from_field
underscoreize ( string ) #=> 'resent_from_field'
221 222 223 |
# File 'lib/mail/utilities.rb', line 221 def underscoreize( str ) str.to_s.downcase.tr(Constants::HYPHEN, Constants::UNDERSCORE) end |