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 that control the behaviour of the method;

  • Options:

    • :reject_hyphens (boolean);

    • :reject_spaces (boolean);

    • :reject_tabs (boolean);

    • :reject_whitespace (boolean);

    • :transform_characters (boolean);



143
144
145
146
# File 'lib/xqsr3/string_utilities/to_symbol.rb', line 143

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



151
152
153
154
# File 'lib/xqsr3/string_utilities/to_symbol.rb', line 151

def to_symbol options = {}

  ToSymbol_Helper_.string_to_symbol_with_options_ self, options
end