Sha256: 39fb7d6aa4a17a14da73620b6648620ba87ca616d27244456cb207687ac91e82

Contents?: true

Size: 548 Bytes

Versions: 28

Compression:

Stored size: 548 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module Patients
    class TemperatureValidator < ActiveModel::EachValidator
      include NumericRangeValidations
      include NumericScaleValidations
      MIN_VALUE = 28.0
      MAX_VALUE = 45.0
      MAX_DECIMAL_PLACES = 1

      def validate_each(record, attribute, value)
        return if value.blank?
        validate_number_is_in_range(record, attribute, value, MIN_VALUE, MAX_VALUE)
        validate_numeric_scale(record, attribute, value, MAX_DECIMAL_PLACES)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
renalware-core-2.0.46 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.45 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.44 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.43 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.42 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.41 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.40 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.39 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.38 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.37 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.36 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.35 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.34 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.33 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.32 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.31 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.30 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.28 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.27 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.26 app/validators/renalware/patients/temperature_validator.rb