Sha256: 7751e146b0b5f0a1668fe027c26d6abfaf32fa5640e7756f2b9bd23ddf62f144

Contents?: true

Size: 416 Bytes

Versions: 21

Compression:

Stored size: 416 Bytes

Contents

# typed: strict
# frozen_string_literal: true

module DearInventory
  module Validators
    class Integer < DearInventory::Validator
      extend T::Sig

      sig { override.void }
      def call
        value = instance_variable_get(:@value)
        return if value.nil?
        return if value.is_a?(::Integer)

        raise_error("expected an Integer but received #{value.inspect}")
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
dear_inventory-1.4.0 lib/dear_inventory/validators/integer.rb
dear_inventory-1.3.0 lib/dear_inventory/validators/integer.rb
dear_inventory-1.2.0 lib/dear_inventory/validators/integer.rb
dear_inventory-1.1.1 lib/dear_inventory/validators/integer.rb
dear_inventory-1.1.0 lib/dear_inventory/validators/integer.rb
dear_inventory-1.0.0 lib/dear_inventory/validators/integer.rb
dear_inventory-0.7.5 lib/dear_inventory/validators/integer.rb
dear_inventory-0.7.4 lib/dear_inventory/validators/integer.rb
dear_inventory-0.7.3 lib/dear_inventory/validators/integer.rb
dear_inventory-0.7.2 lib/dear_inventory/validators/integer.rb
dear_inventory-0.7.1 lib/dear_inventory/validators/integer.rb
dear_inventory-0.7.0 lib/dear_inventory/validators/integer.rb
dear_inventory-0.6.3 lib/dear_inventory/validators/integer.rb
dear_inventory-0.6.2 lib/dear_inventory/validators/integer.rb
dear_inventory-0.6.1 lib/dear_inventory/validators/integer.rb
dear_inventory-0.6.0 lib/dear_inventory/validators/integer.rb
dear_inventory-0.5.0 lib/dear_inventory/validators/integer.rb
dear_inventory-0.4.1 lib/dear_inventory/validators/integer.rb
dear_inventory-0.4.0 lib/dear_inventory/validators/integer.rb
dear_inventory-0.3.0 lib/dear_inventory/validators/integer.rb