Sha256: 8be076a67bab6f8a41da1b75457abd3e6958d77641ceced35cadae7de525a752
Contents?: true
Size: 597 Bytes
Versions: 8
Compression:
Stored size: 597 Bytes
Contents
# frozen_string_literal: true require "key_vortex/constraint/base" require "key_vortex/constraint/length" require "key_vortex/constraint/maximum" require "key_vortex/constraint/minimum" class KeyVortex class Constraint def self.build(attribute, value) case attribute when :length KeyVortex::Constraint::Length.new(value) when :maximum KeyVortex::Constraint::Maximum.new(value) when :minimum KeyVortex::Constraint::Minimum.new(value) else raise KeyVortex::Error, "Unexpected attribute: #{attribute}" end end end end
Version data entries
8 entries across 8 versions & 1 rubygems