Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/gui/base.rb,
lib/gui/base.rb

Instance Method Summary collapse

Instance Method Details

#just_lettersObject



745
746
747
# File 'lib/gui/base.rb', line 745

def just_letters
    gsub(/[^a-z0-9]/i, '').downcase
end

#quotifyObject



31
32
33
# File 'lib/gui/base.rb', line 31

def quotify
  '"' + self + '"'
end

#snake_caseObject



24
25
26
27
28
29
30
# File 'lib/gui/base.rb', line 24

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