Sha256: 1edfeee378267d2b505e92f1f2d1b6da2be40954c4ed3ef24c9397c3cf8ae19c
Contents?: true
Size: 417 Bytes
Versions: 7
Compression:
Stored size: 417 Bytes
Contents
# frozen_string_literal: true module Dry module Schema module Macros # # Macros DSL for options with default values # (see https://github.com/dry-rb/dry-schema/issues/70) # class DSL def default(value) schema_dsl.before(:rule_applier) do |result| result.update(name => value) unless result[name] end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems