Sha256: a9da0787b646ba59ea3947b7f35753a254e59c0c44aa3b9f20b7aa08f6db1cfd

Contents?: true

Size: 413 Bytes

Versions: 1

Compression:

Stored size: 413 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 :lon
#     validates :lon, longitude: true
#   end
class LongitudeValidator < BaseValidator
  private

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

Version data entries

1 entries across 1 versions & 1 rubygems

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