Sha256: e74f52f2a7cb101709acec524676c4efe14c3db81bb5c7a6ac4be21cb83d654e
Contents?: true
Size: 499 Bytes
Versions: 13
Compression:
Stored size: 499 Bytes
Contents
# frozen_string_literal: true module Hako module Schema class OrderedArray def initialize(schema) @schema = schema end def valid?(object) object.is_a?(Array) && object.all? { |e| @schema.valid?(e) } end def same?(xs, ys) if xs.size != ys.size return false end xs.zip(ys) do |x, y| unless @schema.same?(x, y) return false end end true end end end end
Version data entries
13 entries across 13 versions & 1 rubygems