Class: Net::Openvpn::Host

Inherits:
Object
  • Object
show all
Defined in:
lib/net/openvpn/host.rb

Instance Method Summary collapse

Constructor Details

#initialize(hostname) ⇒ Host

Returns a new instance of Host.



5
6
7
8
# File 'lib/net/openvpn/host.rb', line 5

def initialize(hostname)
  @hostname = hostname
  @config = Net::Openvpn::ClientConfig.new(@hostname)
end

Instance Method Details

#generate_keyObject



10
11
12
# File 'lib/net/openvpn/host.rb', line 10

def generate_key

end

#generate_ovpnObject



14
15
16
# File 'lib/net/openvpn/host.rb', line 14

def generate_ovpn

end

#ip=(ip) ⇒ Object



18
19
20
# File 'lib/net/openvpn/host.rb', line 18

def ip=(ip)
  @config.ip = ip
end

#network=(network) ⇒ Object



22
23
24
# File 'lib/net/openvpn/host.rb', line 22

def network=(network)
  @config.network = network
end

#new?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/net/openvpn/host.rb', line 34

def new?
  !@config.exists?
end

#removeObject



30
31
32
# File 'lib/net/openvpn/host.rb', line 30

def remove
  @config.remove
end

#saveObject



26
27
28
# File 'lib/net/openvpn/host.rb', line 26

def save
  @config.save
end