Class: Stylesheet::Inflector
- Inherits:
-
Object
- Object
- Stylesheet::Inflector
- Defined in:
- lib/stylesheet/inflector.rb
Class Method Summary collapse
Class Method Details
.camelize(string) ⇒ Object
3 4 5 |
# File 'lib/stylesheet/inflector.rb', line 3 def self.camelize(string) string.gsub(/(-)(.)/) {|m| m[1].upcase } end |
.dasherize(string) ⇒ Object
7 8 9 |
# File 'lib/stylesheet/inflector.rb', line 7 def self.dasherize(string) string.gsub(/(.)([A-Z])/) {|m| "#{m[0]}-#{m[1].downcase}" } end |