class Speculation::NonconformingSpec

@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.

Public Class Methods

new(spec, gen = nil) click to toggle source
# File lib/speculation/spec/nonconforming_spec.rb, line 13
def initialize(spec, gen = nil)
  @spec = spec
  @gen = gen
  @delayed_spec = Concurrent::Delay.new { S.send(:specize, spec) }
end

Public Instance Methods

conform(value) click to toggle source
# File lib/speculation/spec/nonconforming_spec.rb, line 19
def conform(value)
  ret = @delayed_spec.value!.conform(value)

  S.invalid?(ret) ? :"Speculation/invalid" : value
end
explain(path, via, inn, value) click to toggle source
# File lib/speculation/spec/nonconforming_spec.rb, line 29
def explain(path, via, inn, value)
  @delayed_spec.value!.explain(path, via, inn, value)
end
gen(overrides, path, rmap) click to toggle source
# File lib/speculation/spec/nonconforming_spec.rb, line 37
def gen(overrides, path, rmap)
  @delayed_spec.value!.gen(overrides, path, rmap)
end
unform(value) click to toggle source
# File lib/speculation/spec/nonconforming_spec.rb, line 25
def unform(value)
  value
end
with_gen(gen) click to toggle source
# File lib/speculation/spec/nonconforming_spec.rb, line 33
def with_gen(gen)
  self.class.new(@spec, gen)
end