Sha256: 717834ded79ad5ce879faac16595039ae221fd49ce435eb4abe2981f3bd06d7e

Contents?: true

Size: 431 Bytes

Versions: 2

Compression:

Stored size: 431 Bytes

Contents

module NxtSchema
  module Types
    include Dry.Types()

    StrippedString = Strict::String.constructor(->(string) { string&.strip })
    LengthyStrippedString = 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

2 entries across 2 versions & 1 rubygems

Version Path
nxt_schema-1.0.1 lib/nxt_schema/types.rb
nxt_schema-1.0.0 lib/nxt_schema/types.rb