Module: Xqsr3::CommandLineUtilities::MapOptionString
- Included in:
- String
- Defined in:
- lib/xqsr3/command_line_utilities/map_option_string.rb
Overview
include
-able module providing facilities for mapping strings to options
Components of interest
-
::Xqsr3::CommandLineUtilities::MapOptionString.map_option_string_from_string
-
::Xqsr3::CommandLineUtilities::MapOptionString#map_option_string
Class Method Summary collapse
-
.included(includer) ⇒ Object
:nodoc:.
-
.map_option_string_from_string(s, option_strings, options = {}) ⇒ Object
Attempts to translate the value of a given string according to a collection of options strings.
Instance Method Summary collapse
-
#map_option_string(option_strings, options = {}) ⇒ Object
Attempts to translate the (string) value of the receiver according to a collection of options strings.
Class Method Details
.included(includer) ⇒ Object
:nodoc:
65 66 67 68 |
# File 'lib/xqsr3/command_line_utilities/map_option_string.rb', line 65 def self.included includer # :nodoc: raise TypeError, "module #{self} cannot be included into #{includer} because it does not respond to to_str" unless includer.method_defined? :to_str end |
.map_option_string_from_string(s, option_strings, options = {}) ⇒ Object
Attempts to translate the value of a given string according to a collection of options strings
Signature
-
Parameters:
-
s
(String
) The string to be mapped; -
option_strings
(+[ String ]+) An array of strings against which the mapping will be performed; -
options
(Hash
) Options that control the behaviour of the method;
-
126 127 128 129 |
# File 'lib/xqsr3/command_line_utilities/map_option_string.rb', line 126 def self.map_option_string_from_string s, option_strings, = {} MapOptionString_Helper_. s, option_strings, end |
Instance Method Details
#map_option_string(option_strings, options = {}) ⇒ Object
Attempts to translate the (string) value of the receiver according to a collection of options strings
Signature
-
Parameters:
-
option_strings
(+[ String ]+) An array of strings against which the mapping will be performed;
-
138 139 140 141 142 143 |
# File 'lib/xqsr3/command_line_utilities/map_option_string.rb', line 138 def map_option_string option_strings, = {} s = self.kind_of?(::String) ? self : self.to_str MapOptionString_Helper_. s, option_strings, end |