Class: Dry::Schema::Macros::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/mihari/schemas/macros.rb

Instance Method Summary collapse

Instance Method Details

#default(value) ⇒ Object



7
8
9
10
11
# File 'lib/mihari/schemas/macros.rb', line 7

def default(value)
  schema_dsl.before(:rule_applier) do |result|
    result.update(name => value) unless result[name]
  end
end