Sha256: 6b3267b2f6c43d785d383e8c04ae802364b3289821a831109194146cf744e0a6

Contents?: true

Size: 218 Bytes

Versions: 37

Compression:

Stored size: 218 Bytes

Contents

class String
  def blank?
    strip.empty?
  end
  
  def snake_case
    return self.downcase if self =~ /^[A-Z]+$/
    self.gsub(/([A-Z]+)(?=[A-Z][a-z]?)|\B[A-Z]/, '_\&') =~ /_*(.*)/
      return $+.downcase
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
videojuicer-vj-sdk-0.1.12 lib/core_ext/string.rb
vj-sdk-0.8.2 lib/core_ext/string.rb
vj-sdk-0.8.0.1 lib/core_ext/string.rb
vj-sdk-0.7.14 lib/core_ext/string.rb
vj-sdk-0.7.13 lib/core_ext/string.rb
vj-sdk-0.7.11 lib/core_ext/string.rb
vj-sdk-0.7.10 lib/core_ext/string.rb
vj-sdk-0.7.9 lib/core_ext/string.rb
vj-sdk-0.7.8 lib/core_ext/string.rb
vj-sdk-0.7.7 lib/core_ext/string.rb
vj-sdk-0.7.6 lib/core_ext/string.rb
vj-sdk-0.7.5 lib/core_ext/string.rb
vj-sdk-0.7.4 lib/core_ext/string.rb
vj-sdk-0.7.3 lib/core_ext/string.rb
vj-sdk-0.7.2 lib/core_ext/string.rb
vj-sdk-0.7.1 lib/core_ext/string.rb
vj-sdk-0.7.0 lib/core_ext/string.rb
vj-sdk-0.6.9 lib/core_ext/string.rb
vj-sdk-0.6.8 lib/core_ext/string.rb
vj-sdk-0.6.7 lib/core_ext/string.rb