Method: Kernel#generate
- Defined in:
- lib/string/pattern/add_to_ruby.rb
#generate(pattern, expected_errors: [], **synonyms) ⇒ Object Also known as: gen
if string or symbol supplied it will generate a string with the supplied pattern specified on the string if array supplied then it will generate a string with the supplied patterns. If a position contains a pattern supply it as symbol, for example: [:"10:N", "fixed", :"10-20:XN/x/"]
275 276 277 278 279 280 281 |
# File 'lib/string/pattern/add_to_ruby.rb', line 275 def generate(pattern, expected_errors: [], **synonyms) if pattern.is_a?(String) || pattern.is_a?(Array) || pattern.is_a?(Symbol) || pattern.is_a?(Regexp) StringPattern.generate(pattern, expected_errors: expected_errors, **synonyms) else puts " Kernel generate method: class not recognized:#{pattern.class}" end end |