Sha256: da9c1bd231dc0e8b459dc3e1c9a2df1a54b8710375db2e40957b7010778ac68b
Contents?: true
Size: 510 Bytes
Versions: 9
Compression:
Stored size: 510 Bytes
Contents
module Schematic module Generator module Restrictions class Pattern < Base def generate(builder) for_validator ActiveModel::Validations::FormatValidator do |validator| if pattern = validator.options[:with] value = pattern.source value.gsub!(/^(?:\^|\\A|\\a)?/, '') value.gsub!(/(?:\$|\\Z|\\z)?$/, '') builder.xs(:pattern, "value" => value) end end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems