module Kernel
Public Instance Methods
generate(pattern, expected_errors: [], **synonyms)
click to toggle source
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/”]
# File lib/string/pattern/add_to_ruby.rb, line 283 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
Also aliased as: gen