Class: String

Inherits:
Object show all
Defined in:
lib/gui/sensible-cinema-base.rb,
lib/gui/sensible-cinema-base.rb

Overview

LODO move to sane :) also remove the andand dep.

Instance Method Summary collapse

Instance Method Details

#present?Boolean

Returns:

  • (Boolean)


638
639
640
# File 'lib/gui/sensible-cinema-base.rb', line 638

def present?
  length > 0
end

#snake_caseObject



25
26
27
28
29
30
31
# File 'lib/gui/sensible-cinema-base.rb', line 25

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