Module: Xqsr3::StringUtilities::ToSymbol

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

Overview

To-symbol conversion facilities

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.string_to_symbol(s, options = {}) ⇒ Object

Converts the given string s to a symbol according to the given options

Signature

  • Parameters:

    • s (String) The string to convert

    • options (Hash) Options hash

  • Options:

    • :reject_hyphens (boolean)

    • :reject_spaces (boolean)

    • :reject_tabs (boolean)

    • :reject_whitespace (boolean)

    • :transform_characters (boolean)



146
147
148
149
# File 'lib/xqsr3/string_utilities/to_symbol.rb', line 146

def self.string_to_symbol s, options = {}

  ToSymbol_Helper_.string_to_symbol_with_options_ s, options
end

Instance Method Details

#to_symbol(options = {}) ⇒ Object

Converts the instance to a symbol, according to the given options

See Xqsr3::StringUtilities::ToSymbol::string_to_symbol for options



154
155
156
157
# File 'lib/xqsr3/string_utilities/to_symbol.rb', line 154

def to_symbol options = {}

  ToSymbol_Helper_.string_to_symbol_with_options_ self, options
end