Class: Casing::Underscore

Inherits:
Object
  • Object
show all
Extended by:
Casing
Defined in:
lib/casing/underscore.rb,
lib/casing/underscore/hash.rb,
lib/casing/underscore/array.rb,
lib/casing/underscore/string.rb

Defined Under Namespace

Modules: Array, Hash, String

Class Method Summary collapse

Methods included from Casing

!, call, case?, value_cased?

Class Method Details

.match?(val) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/casing/underscore.rb', line 5

def self.match?(val)
  !!((((val =~ /^[a-z]/) && (val =~ /_/)) || (val =~ /^[a-z]/)) && !(val =~ /[A-Z]/))
end