Module: Doing::StringNormalize

Included in:
String
Defined in:
lib/doing/normalize.rb

Overview

String to symbol conversion

Instance Method Summary collapse

Instance Method Details

#normalize_age(default = :newest) ⇒ Symbol

Convert an age string to a qualified type

Returns:

  • (Symbol)

    :oldest or :newest

#normalize_age!(default = :newest) ⇒ Object

See Also:

#normalize_bool(default = :and) ⇒ Object

Convert a boolean string to a symbol

Returns:

  • Symbol :and, :or, or :not

#normalize_bool!(default = :and) ⇒ Object

See Also:

#normalize_case(default = :smart) ⇒ Object

Convert a case sensitivity string to a symbol

Returns:

  • Symbol :smart, :sensitive, :ignore

#normalize_case!(default = :smart) ⇒ Object

See Also:

#normalize_matching(default = :pattern) ⇒ Object

Convert a matching configuration string to a symbol

Parameters:

  • default (Symbol) (defaults to: :pattern)

    the default matching type to return if the string doesn't match a known symbol

Returns:

  • Symbol :fuzzy, :pattern, :exact

#normalize_matching!(default = :pattern) ⇒ Object

#normalize_order(default = :asc) ⇒ Object

#normalize_order!(default = :asc) ⇒ Symbol

Convert a sort order string to a qualified type

Returns:

#normalize_tag_sort(default = :name) ⇒ Symbol

Convert tag sort string to a qualified type

Returns:

#normalize_tag_sort!(default = :name) ⇒ Object

#normalize_triggerString

Adds ?: to any parentheticals in a regular expression to avoid match groups

Returns:

  • (String)

    modified regular expression

#normalize_trigger!Object

See Also: