Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/aspera/colors.rb

Overview

simple vt100 colors

Instance Method Summary collapse

Instance Method Details

#capital_to_snakeObject



56
57
58
59
60
# File 'lib/aspera/colors.rb', line 56

def capital_to_snake
  return gsub(/([a-z\d])([A-Z])/, '\1_\2')
      .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
      .downcase
end