Sha256: dcb0f1409b7cba3da51048aef521dd52d65010466645c03636f1d8e6e3813ae1
Contents?: true
Size: 572 Bytes
Versions: 20
Compression:
Stored size: 572 Bytes
Contents
module Shogun module Verifier class Match def initialize(data:, name:, comparison:) @data = data @name = name @comparison = comparison end def valid? if @comparison.is_a?(Regexp) @data =~ @comparison else @data == @comparison || @comparison == @data end end def id "#{@name}_does_not_match" end def context if @comparison.is_a?(Regexp) { "pattern" => @comparison } end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems