Sha256: 09d725f1ac8fce62c4a59d27dcf9cf00984e97ff3f9763b59e8c120d12cd346f

Contents?: true

Size: 1.15 KB

Versions: 6

Compression:

Stored size: 1.15 KB

Contents

module VagrantPlugins
  module Invade
    module Generator
      module MachinePart

        class Network

          attr_accessor :machine_name, :type, :network_data

          def initialize(machine_name, type, network_data)
            @machine_name = machine_name
            @type = type
            @network_data = network_data
          end

          def generate

            case @type
            when 'private', 'private_network', 'privatenetwork', 'private-network'
              network = Builder::Network::PrivateNetwork.new(@machine_name, @network_data)
            when 'forwarded', 'forwarded_port', 'forwarded-port', 'forwardedport', 'port'
              network = Builder::Network::ForwardedPort.new(@machine_name, @network_data)
            when 'public', 'puplic_network', 'publicnetwork', 'public-network'
              network = Builder::Network::PublicNetwork.new(@machine_name, @network_data)
            else
              raise StandardError, "Network type unknown or not set. Please check the network configuration."
            end

            network.build

            network.result
          end

        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-invade-0.5.5 lib/vagrant-invade/generator/machine_part/network.rb
vagrant-invade-0.5.4 lib/vagrant-invade/generator/machine_part/network.rb
vagrant-invade-0.5.3 lib/vagrant-invade/generator/machine_part/network.rb
vagrant-invade-0.5.2 lib/vagrant-invade/generator/machine_part/network.rb
vagrant-invade-0.5.1 lib/vagrant-invade/generator/machine_part/network.rb
vagrant-invade-0.5.0 lib/vagrant-invade/generator/machine_part/network.rb