Tools

A library of utility services and concerns.

Class: SleepingKingStudios::Tools::Toolbox::Inflector

Parent Namespace
SleepingKingStudios::Tools::Toolbox
Extended Modules
Forwardable
Defined In
lib/sleeping_king_studios/tools/toolbox/inflector.rb

Table Of Contents

Overview

Service object for transforming strings.

Internally, an instance of this class is used to StringTools to perform string transformations.

This class should define a compatible interface with ActiveSupport::Inflector, i.e. all methods defined on Toolbox::Inflector should have a corresponding method on ActiveSupport::Inflector with a superset of the parameters. (The reverse is not true).

See Also

Back To Top

Defined Under Namespace

Classes
Rules

Back To Top

Constructor

#initialize(rules: nil) => Inflector

Parameters

Returns

Back To Top

Instance Attributes

#rules => SleepingKingStudios::Tools::Toobox::Inflector::Rules (readonly)

Returns

Back To Top

Instance Methods

#camelize(word, uppercase_first_letter = true) => String

Converts a lowercase, underscore-separated string to CamelCase.

Parameters

Returns

#pluralize(word) => String

Transforms the word to a plural, lowercase form.

Parameters

Returns

#singularize(word) => String

Transforms the word to a singular, lowercase form.

Parameters

Returns

#underscore(word) => String

Transforms the word to a lowercase, underscore-separated form.

Parameters

Returns

Back To Top


Back to Documentation | Reference | SleepingKingStudios | SleepingKingStudios::Tools | SleepingKingStudios::Tools::Toolbox