Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/sinatra/liveviews/json-websocket.rb

Instance Method Summary collapse

Instance Method Details

#underscoreObject



94
95
96
97
98
99
100
# File 'lib/sinatra/liveviews/json-websocket.rb', line 94

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