Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/string/pattern/add_to_ruby.rb
Instance Method Summary collapse
-
#generate(expected_errors: [], **synonyms) ⇒ Object
(also: #gen)
It will generate an string following the pattern specified The positions with string patterns need to be supplied like symbols: [:"10:N", "fixed", :"10-20:XN/x/"].generate #> "1024320001fixed4OZjNMTnuBibwwj".
-
#validate(string_to_validate, expected_errors: [], not_expected_errors: [], **synonyms) ⇒ Object
(also: #val)
it will validate an string following the pattern specified.
Instance Method Details
#generate(expected_errors: [], **synonyms) ⇒ Object Also known as: gen
It will generate an string following the pattern specified The positions with string patterns need to be supplied like symbols: [:"10:N", "fixed", :"10-20:XN/x/"].generate #> "1024320001fixed4OZjNMTnuBibwwj"
5 6 7 |
# File 'lib/string/pattern/add_to_ruby.rb', line 5 def generate(expected_errors: [], **synonyms) StringPattern.generate(self, expected_errors: expected_errors, **synonyms) end |
#validate(string_to_validate, expected_errors: [], not_expected_errors: [], **synonyms) ⇒ Object Also known as: val
it will validate an string following the pattern specified
12 13 14 |
# File 'lib/string/pattern/add_to_ruby.rb', line 12 def validate(string_to_validate, expected_errors: [], not_expected_errors: [], **synonyms) StringPattern.validate(text: string_to_validate, pattern: self, expected_errors: expected_errors, not_expected_errors: not_expected_errors, **synonyms) end |