Class: String
- Defined in:
- lib/doing/colors.rb,
lib/doing/good.rb,
lib/doing/normalize.rb
Overview
String to symbol conversion
Direct Known Subclasses
Instance Method Summary collapse
-
#good? ⇒ Boolean
Tests if object is nil or empty.
-
#normalize_age(default = :newest) ⇒ Symbol
Convert an age string to a qualified type.
- #normalize_age!(default = :newest) ⇒ Object
-
#normalize_bool(default = :and) ⇒ Object
Convert a boolean string to a symbol.
- #normalize_bool!(default = :and) ⇒ Object
-
#normalize_case(default = :smart) ⇒ Object
Convert a case sensitivity string to a symbol.
- #normalize_case!(default = :smart) ⇒ Object
-
#normalize_color ⇒ String
Normalize a color name, removing underscores, replacing "bright" with "bold", and converting bgbold to boldbg.
-
#normalize_matching(default = :pattern) ⇒ Object
Convert a matching configuration string to a symbol.
- #normalize_matching!(default = :pattern) ⇒ Object
- #normalize_order(default = :asc) ⇒ Object
-
#normalize_order!(default = :asc) ⇒ Symbol
Convert a sort order string to a qualified type.
-
#normalize_tag_sort(default = :name) ⇒ Symbol
Convert tag sort string to a qualified type.
- #normalize_tag_sort!(default = :name) ⇒ Object
-
#normalize_trigger ⇒ String
Adds ?: to any parentheticals in a regular expression to avoid match groups.
- #normalize_trigger! ⇒ Object
-
#validate_color ⇒ String
Extract the longest valid %color name from a string.
Instance Method Details
#good? ⇒ Boolean
Tests if object is nil or empty
#normalize_age(default = :newest) ⇒ Symbol
Convert an age string to a qualified type
#normalize_age!(default = :newest) ⇒ Object
#normalize_bool(default = :and) ⇒ Object
Convert a boolean string to a symbol
#normalize_bool!(default = :and) ⇒ Object
#normalize_case(default = :smart) ⇒ Object
Convert a case sensitivity string to a symbol
#normalize_case!(default = :smart) ⇒ Object
#normalize_color ⇒ String
Normalize a color name, removing underscores, replacing "bright" with "bold", and converting bgbold to boldbg
#normalize_matching(default = :pattern) ⇒ Object
Convert a matching configuration string to a symbol
#normalize_matching!(default = :pattern) ⇒ Object
#normalize_order(default = :asc) ⇒ Object
#normalize_order!(default = :asc) ⇒ Symbol
Convert a sort order string to a qualified type
#normalize_tag_sort(default = :name) ⇒ Symbol
Convert tag sort string to a qualified type
#normalize_tag_sort!(default = :name) ⇒ Object
#normalize_trigger ⇒ String
Adds ?: to any parentheticals in a regular expression to avoid match groups
#normalize_trigger! ⇒ Object
#validate_color ⇒ String
Extract the longest valid %color name from a string.
Allows %colors to bleed into other text and still be recognized, e.g. %greensomething still finds %green.