Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/openstudio-workflow.rb

Overview

some core extensions

Instance Method Summary collapse

Instance Method Details

#snake_caseObject



52
53
54
55
56
57
58
# File 'lib/openstudio-workflow.rb', line 52

def snake_case
  gsub(/::/, '/')
    .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
    .gsub(/([a-z\d])([A-Z])/, '\1_\2')
    .tr(' -', '__')
    .downcase
end