Sha256: 3a1afad88ef3a030816302f3659f89cef2b1eb28a0933083078a1c48ac551183

Contents?: true

Size: 549 Bytes

Versions: 114

Compression:

Stored size: 549 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

114 entries across 114 versions & 1 rubygems

Version Path
renalware-core-2.0.104 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.103 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.102 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.101 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.100 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.99 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.98 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.97 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.96 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.95 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.94 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.93 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.92 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.91 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.90 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.89 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.88 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.87 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.86 app/validators/renalware/patients/temperature_validator.rb
renalware-core-2.0.85 app/validators/renalware/patients/temperature_validator.rb