Sha256: fbfa2620d6c3860c1be128ce9720a7d43990ce379603eef92d51f1336c4c765f

Contents?: true

Size: 289 Bytes

Versions: 53

Compression:

Stored size: 289 Bytes

Contents

# frozen_string_literal: true

module Dry
  module Schema
    module Macros
      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

53 entries across 53 versions & 1 rubygems

Version Path
mihari-5.6.2 lib/mihari/schemas/macros.rb
mihari-5.6.1 lib/mihari/schemas/macros.rb
mihari-5.6.0 lib/mihari/schemas/macros.rb
mihari-5.5.0 lib/mihari/schemas/macros.rb
mihari-5.4.9 lib/mihari/schemas/macros.rb
mihari-5.4.8 lib/mihari/schemas/macros.rb
mihari-5.4.7 lib/mihari/schemas/macros.rb
mihari-5.4.6 lib/mihari/schemas/macros.rb
mihari-5.4.5 lib/mihari/schemas/macros.rb
mihari-5.4.4 lib/mihari/schemas/macros.rb
mihari-5.4.3 lib/mihari/schemas/macros.rb
mihari-5.4.2 lib/mihari/schemas/macros.rb
mihari-5.4.1 lib/mihari/schemas/macros.rb
mihari-5.4.0 lib/mihari/schemas/macros.rb
mihari-5.3.2 lib/mihari/schemas/macros.rb
mihari-5.3.1 lib/mihari/schemas/macros.rb
mihari-5.3.0 lib/mihari/schemas/macros.rb
mihari-5.2.4 lib/mihari/schemas/macros.rb
mihari-5.2.3 lib/mihari/schemas/macros.rb
mihari-5.2.2 lib/mihari/schemas/macros.rb