Module: Doing::StringTransform
- Included in:
- String
- Defined in:
- lib/doing/string/transform.rb
Overview
String helpers
Instance Method Summary collapse
-
#cap_first ⇒ Object
Capitalize on the first character on string.
-
#compress ⇒ Object
Compress multiple spaces to single space.
- #compress! ⇒ Object
-
#set_type(kind = nil) ⇒ Object
Convert a string value to an appropriate type.
- #simple_wrap(width) ⇒ Object
- #titlecase ⇒ Object
-
#to_p(number) ⇒ Object
Pluralize a string based on quantity.
-
#wrap(len, pad: 0, indent: ' ', offset: 0, prefix: '', color: '', after: '', reset: '', pad_first: false) ⇒ Object
Wrap string at word breaks, respecting tags.
Instance Method Details
#cap_first ⇒ Object
Capitalize on the first character on string
#compress ⇒ Object
Compress multiple spaces to single space
#compress! ⇒ Object
#set_type(kind = nil) ⇒ Object
Convert a string value to an appropriate type. If kind is not specified, '[one, two]' becomes an Array, '1' becomes Integer, '1.5' becomes Float, 'true' or 'yes' becomes TrueClass, 'false' or 'no' becomes FalseClass.
#simple_wrap(width) ⇒ Object
#titlecase ⇒ Object
#to_p(number) ⇒ Object
Pluralize a string based on quantity
#wrap(len, pad: 0, indent: ' ', offset: 0, prefix: '', color: '', after: '', reset: '', pad_first: false) ⇒ Object
Wrap string at word breaks, respecting tags