Method: StewEucen::Acts::IntactCase::String#hyphenated

Defined in:
lib/intact_case/modules.rb

#hyphenated(as_vendor_prefix = false) ⇒ string

Hyphenate compound words from camelCase|StudlyCaps.

Examples:

camelCase|StudlyCaps to hyphenated string.

'chainCase'.hyphenated          #=> 'chain-case'
'VendorPrefix'.hyphenated(true) #=> '-vendor-prefix'
'camelCase'.hyphenated(true)    #=> 'camel-case'

Parameters:

  • as_vendor_prefix (boolean) (defaults to: false)

    Treat as vendor-prefix (CSS).

Returns:

  • (string)

    Hyphenated string.

Author:

  • StewEucen

Since:

  • Release 1.0.0



111
112
113
# File 'lib/intact_case/modules.rb', line 111

def hyphenated(as_vendor_prefix = false)
  self.delimiterize('-', as_vendor_prefix)
end