Sha256: 1942e965c29b1addf308de729da69c9a2d695b4e0590d97b91322da7f43b0c67
Contents?: true
Size: 419 Bytes
Versions: 13
Compression:
Stored size: 419 Bytes
Contents
# frozen_string_literal: true module Hako module Schema class Nullable def initialize(schema) @schema = schema end def valid?(object) object.nil? || @schema.valid?(object) end def same?(x, y) if x.nil? && y.nil? true elsif x.nil? || y.nil? false else @schema.same?(x, y) end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems