Sha256: ee9a10a67732e02ec17e819dfca215ab7d6ae2ae5a218319fdcbe2f82abc0e7a
Contents?: true
Size: 655 Bytes
Versions: 33
Compression:
Stored size: 655 Bytes
Contents
module Quby module Questionnaires module Entities class Validation attr_reader :config def initialize(config) @config = config end def type config[:type] end def as_json case type when :regexp valc = config.clone valc[:matcher] = valc[:matcher].source.to_s # Replace single backslashes with two backslashes valc[:matcher].gsub!("\\", "\\\\") valc else config end.deep_transform_keys{ |key| key.to_s.camelize(:lower) } end end end end end
Version data entries
33 entries across 33 versions & 1 rubygems