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
sto the givenwidthaccording to the givenoptions.
Instance Method Summary collapse
-
#truncate(width, options = {}) ⇒ Object
Truncates the instance, according to the given
widthandoptions.
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 that control the behaviour of the method;
-
Options:
:omission(+String+) Omission string. Defaults to "...";
115 116 117 118 |
# File 'lib/xqsr3/string_utilities/truncate.rb', line 115 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
123 124 125 126 |
# File 'lib/xqsr3/string_utilities/truncate.rb', line 123 def truncate width, = {} Truncate_Helper_. self, width, end |