Module: Xqsr3::CommandLineUtilities::MapOptionString
- Included in:
- String
- Defined in:
- lib/xqsr3/command_line_utilities/map_option_string.rb
Overview
Facilities for mapping strings to options
Components of interest
-
::Xqsr3::CommandLineUtilities::MapOptionString.map_option_string
Defined Under Namespace
Modules: MapOptionString_Helper_
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:
66 67 68 69 |
# File 'lib/xqsr3/command_line_utilities/map_option_string.rb', line 66 def self.included includer 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
120 121 122 123 |
# File 'lib/xqsr3/command_line_utilities/map_option_string.rb', line 120 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
127 128 129 130 131 132 |
# File 'lib/xqsr3/command_line_utilities/map_option_string.rb', line 127 def map_option_string option_strings, = {} s = self.kind_of?(::String) ? self : self.to_str MapOptionString_Helper_. s, option_strings, end |