Class: Cmdlet::Case::Snake

Inherits:
BaseCmdlet show all
Defined in:
lib/cmdlet/case/snake.rb

Overview

Snake: Snake case the characters in the given 'string'

Instance Method Summary collapse

Methods inherited from BaseCmdlet

#tokenizer

Instance Method Details

#call(value) ⇒ String

Returns value converted to snake case.

Parameters:

  • value (String|Int)
    • value - to be converted

Returns:

  • (String)

    value converted to snake case



11
12
13
# File 'lib/cmdlet/case/snake.rb', line 11

def call(value)
  tokenizer.parse(value, separator: '_', forced_separator: true)
end