Sha256: 20a2027a647b2307b2b8da68724e84255618482aa16da39938615f409b688ff4
Contents?: true
Size: 432 Bytes
Versions: 3
Compression:
Stored size: 432 Bytes
Contents
module NxtSchema module Types include Dry.Types() StrippedString = Strict::String.constructor(->(string) { string&.strip }) StrippedNonBlankString = StrippedString.constrained(min_size: 1) Enums = -> (*values) { Strict::String.enum(*values) } # Use as NxtSchema::Types::Enums[*ROLES] SymbolizedEnums = -> (*values) { Coercible::Symbol.enum(*values) } # Use as NxtSchema::Types::SymboleEnums[*ROLES] end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
nxt_schema-0.1.2 | lib/nxt_schema/types.rb |
nxt_schema-0.1.1 | lib/nxt_schema/types.rb |
nxt_schema-0.1.0 | lib/nxt_schema/types.rb |