Sha256: bf6a69d05e3702e607276f09398125266b0494e75b9db74b465ab224712b6b83

Contents?: true

Size: 405 Bytes

Versions: 1

Compression:

Stored size: 405 Bytes

Contents

# frozen_string_literal: true

require "key_vortex/constraint/base"

class KeyVortex
  class Constraint
    class Length < KeyVortex::Constraint::Base
      attr_reader :value

      def initialize(value)
        super()
        @value = value
      end

      def attribute
        :length
      end

      def within_applicable?(constraint)
        value <= constraint.value
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
key-vortex-0.1.3 lib/key_vortex/constraint/length.rb