Module: Xqsr3::StringUtilities::Truncate

Included in:
String
Defined in:
lib/xqsr3/string_utilities/truncate.rb

Overview

To-symbol conversion facilities

Class Method Summary collapse

Instance Method Summary collapse

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, options = {}

	Truncate_Helper_.string_truncate_with_options_ s, width, options
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, options = {}

	Truncate_Helper_.string_truncate_with_options_ self, width, options
end