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



762
763
764
# File 'lib/gui/base.rb', line 762

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