Sha256: 3e924485f4b1ab09c24c7c4cc0aaffc9e861a369fb19b6308dd12fb46a382bd2

Contents?: true

Size: 349 Bytes

Versions: 25

Compression:

Stored size: 349 Bytes

Contents

module MCollective
  module Validator
    class Ipv4addressValidator
      require "ipaddr"

      def self.validate(validator)
        ip = IPAddr.new(validator)
        raise ValidatorError, "value should be an ipv4 adddress" unless ip.ipv4?
      rescue
        raise ValidatorError, "value should be an ipv4 address"
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
choria-mcorpc-support-2.26.4 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.26.3 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.26.2 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.26.1 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.26.0 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.25.3 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.25.2 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.25.1 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.25.0 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.24.4 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.24.3 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.24.2 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.24.1 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.24.0 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.23.3 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.23.2 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.23.1 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.23.0 lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.23.0.pre lib/mcollective/validator/ipv4address_validator.rb
choria-mcorpc-support-2.22.1 lib/mcollective/validator/ipv4address_validator.rb