Sha256: 13bbd7f761d2e8e3e8f44ebe0db954eacc41152d3e65104bba392a0bde88af4e
Contents?: true
Size: 612 Bytes
Versions: 16
Compression:
Stored size: 612 Bytes
Contents
require_relative 'schema_types' module Jimmy class Combination < Array include SchemaCreation::Referencing attr_reader :condition, :schema # @param [Symbol] condition One of :one, :all, or :any def initialize(condition, schema) @condition = condition @schema = schema end def domain schema.domain end def evaluate(types_proc) instance_exec &types_proc end def compile data.merge "#{condition}Of" => map(&:compile) end def data @data ||= {} end SchemaCreation.apply_to(self) { |schema| push schema } end end
Version data entries
16 entries across 16 versions & 1 rubygems