Module: TableSchema::Constraints::Pattern
- Included in:
- TableSchema::Constraints
- Defined in:
- lib/tableschema/constraints/pattern.rb
Instance Method Summary collapse
Instance Method Details
#check_pattern ⇒ Object
5 6 7 8 9 10 |
# File 'lib/tableschema/constraints/pattern.rb', line 5 def check_pattern if !@value.to_json.match /#{@constraints['pattern']}/ raise TableSchema::ConstraintError.new("The value for the field `#{@field['name']}` must match the pattern") end true end |