class Sanatio::BuiltIn::Matching

Public Class Methods

new(regex) click to toggle source
# File lib/sanatio/built-in/matching.rb, line 4
def initialize(regex)
  @regex = regex
end

Public Instance Methods

params() click to toggle source
# File lib/sanatio/built-in/matching.rb, line 20
def params
  [@regex]
end
reason(_) click to toggle source
# File lib/sanatio/built-in/matching.rb, line 16
def reason(_)
  :no_match
end
skip?(value) click to toggle source
# File lib/sanatio/built-in/matching.rb, line 8
def skip?(value)
  !value.respond_to?(:to_str)
end
valid?(value) click to toggle source
# File lib/sanatio/built-in/matching.rb, line 12
def valid?(value)
  @regex.match(value)
end