module Types
The following allow you to access types with Types
.<type reference>
“`ruby email = Types.string.constrained(
format: /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i
) drinking_age = Types.integer.constrained(gt: 21) ““
Public Class Methods
[](type_key)
click to toggle source
@param String The key of the Dry::Type – see Dry::Types.type_keys
# File lib/dry_helper.rb, line 24 def [] (type_key) Dry::Types[type_key] end