Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/fantasy_football_nerd/util.rb
Instance Method Summary collapse
Instance Method Details
#snakecase ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/fantasy_football_nerd/util.rb', line 41 def snakecase self.gsub(/::/, '/'). gsub(/TD/, 'Td'). gsub(/PA/, 'Pa'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("-", "_"). downcase end |