class Speculation::RegexSpec
@private
Constants
- S
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
This is a Ruby translation of clojure.spec:
https://github.com/clojure/clojure/blob/master/src/clj/clojure/spec.clj
All credit belongs with Rich Hickey and contributors for their original work.
Public Class Methods
# File lib/speculation/spec/regex_spec.rb, line 13 def initialize(regex, gen = nil) @regex = regex @gen = gen end
Public Instance Methods
# File lib/speculation/spec/regex_spec.rb, line 18 def conform(value) if value.nil? || Predicates.collection?(value) S.re_conform(@regex, value) else :"Speculation/invalid" end end
# File lib/speculation/spec/regex_spec.rb, line 30 def explain(path, via, inn, value) if value.nil? || Predicates.collection?(value) S.re_explain(path, via, inn, @regex, value || []) else [{ :path => path, :val => value, :via => via, :in => inn }] end end
# File lib/speculation/spec/regex_spec.rb, line 42 def gen(overrides, path, rmap) return @gen.call if @gen S.re_gen(@regex, overrides, path, rmap) end
# File lib/speculation/spec/regex_spec.rb, line 26 def unform(value) S.op_unform(@regex, value) end
# File lib/speculation/spec/regex_spec.rb, line 38 def with_gen(gen) self.class.new(@regex, gen) end