Module: Dry::Data::TypeBuilder
- Included in:
- Constrained, Default, Optional, Safe, Type
- Defined in:
- lib/dry/data/type_builder.rb
Instance Method Summary collapse
- #constrained(options) ⇒ Object
- #default(value) ⇒ Object
- #enum(*values) ⇒ Object
- #optional ⇒ Object
- #safe ⇒ Object
- #|(other) ⇒ Object
Instance Method Details
#constrained(options) ⇒ Object
12 13 14 |
# File 'lib/dry/data/type_builder.rb', line 12 def constrained() Constrained.new(self, rule: Data.Rule(primitive, )) end |
#default(value) ⇒ Object
16 17 18 |
# File 'lib/dry/data/type_builder.rb', line 16 def default(value) Default.new(self, value: value) end |
#enum(*values) ⇒ Object
20 21 22 |
# File 'lib/dry/data/type_builder.rb', line 20 def enum(*values) Enum.new(constrained(inclusion: values), values: values) end |