Sha256: 52f22c2584a881892162b2cf0e86cda159dd27f04b1573e02b61645675a48d7b

Contents?: true

Size: 1.03 KB

Versions: 21

Compression:

Stored size: 1.03 KB

Contents

module VagrantPlugins
  module Invade
    module Validator

      module Network

        #(see https://docs.vagrantup.com/v2/networking/private_network.html)
        class PrivateNetwork

          attr_accessor :env
          attr_accessor :private_network

          DEFAULT = {
            'type' => 'dhcp',
            'ip' => nil # Use default. Vagrant default is NIL if not set
          }

          def initialize(env, private_network)
            @env = env
            @private_network = private_network
          end

          def validate
            return nil unless @private_network

            # NETWORK TYPE (DHCP, not used if IP is given)
            @private_network['type'] = Validator.validate_string(
              @private_network['type'], 'type', DEFAULT['type']
            )

            # IP ADDRESS
            @private_network['ip'] = Validator.validate_string(
              @private_network['ip'], 'ip', DEFAULT['ip']
            )

            @private_network
          end
        end

      end

    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
vagrant-invade-0.5.5 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.5.4 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.5.3 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.5.2 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.5.1 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.5.0 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.8 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.7 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.6 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.5 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.4 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.3 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.2 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.1 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.0 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.4.0.pre.alpha lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.3.4 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.3.3 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.3.2 lib/vagrant-invade/validator/network/private_network.rb
vagrant-invade-0.3.0 lib/vagrant-invade/validator/network/private_network.rb