Sha256: 18dbd0efdd879b5663971de6403d94623d000566b302f3b10e197f49d7134387

Contents?: true

Size: 405 Bytes

Versions: 1

Compression:

Stored size: 405 Bytes

Contents

# Allows to check if the value of a specific attribute is a valid MAC address.
#
# @example Validate that the device MAC address is valid.
#   class Device << ActiveRecord::Base
#     attr_accessor :lat
#     validates :lat, latitude: true
#   end
class LatitudeValidator < BaseValidator
  private

  def self.valid?(latitude, options)
    latitude.present? && latitude >= -90 && latitude <= 90
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
missing_validators-1.1.0 lib/missing_validators/validators/latitude_validator.rb