Class: Cmdlet::Inflection::Pluralize

Inherits:
BaseCmdlet show all
Defined in:
lib/cmdlet/inflection/pluralize.rb

Overview

Pluralize: Returns the plural form of the word in the string

Instance Method Summary collapse

Methods inherited from BaseCmdlet

#tokenizer

Instance Method Details

#call(value) ⇒ String

Returns value in plural form.

Parameters:

  • value (String)
    • value - value to pluralize

Returns:

  • (String)

    value in plural form



11
12
13
14
15
16
17
# File 'lib/cmdlet/inflection/pluralize.rb', line 11

def call(value)
  return '' if value.nil?

  value = value.to_s if value.is_a?(Symbol)

  value.pluralize
end