Module: Xqsr3::StringUtilities::Truncate
- Included in:
- String
- Defined in:
- lib/xqsr3/string_utilities/truncate.rb
Overview
To-symbol conversion facilities
Class Method Summary collapse
-
.string_truncate(s, width, options = {}) ⇒ Object
Truncates the given string
s
to the givenwidth
according to the givenoptions
.
Instance Method Summary collapse
-
#truncate(width, options = {}) ⇒ Object
Truncates the instance, according to the given
width
andoptions
.
Class Method Details
.string_truncate(s, width, options = {}) ⇒ Object
Truncates the given string s
to the given width
according to the given options
Signature
-
Parameters:
-
s
(String) The string to convert -
width
(Integer) The truncation width -
options
(Hash) Options hash
-
-
Options:
-
:omission
(String) Omission string. Defaults to “…”
-
118 119 120 121 |
# File 'lib/xqsr3/string_utilities/truncate.rb', line 118 def self.string_truncate s, width, = {} Truncate_Helper_. s, width, end |
Instance Method Details
#truncate(width, options = {}) ⇒ Object
Truncates the instance, according to the given width
and options
See Xqsr3::StringUtilities::ToSymbol::string_truncate for options
126 127 128 129 |
# File 'lib/xqsr3/string_utilities/truncate.rb', line 126 def truncate width, = {} Truncate_Helper_. self, width, end |