module ActiveConformity::Reifiers

Public Instance Methods

reify_regex(rule) click to toggle source
# File lib/active_conformity/reifiers.rb, line 9
def reify_regex(rule)
  return rule unless rule.is_a?(Hash)
  if rule["format"]
    rule["format"]["with"] = Regexp.new(rule["format"]["with"])
  elsif rule[:format]
    rule[:format][:with] = Regexp.new(rule[:format][:with])
  end
  return rule
end
reify_rule(rule) click to toggle source
# File lib/active_conformity/reifiers.rb, line 5
def reify_rule(rule)
  reify_regex(rule).deep_symbolize_keys
end