class Net::Openvpn::Host

Attributes

hostname[R]
ip[RW]
name[R]
network[RW]

Public Class Methods

new(hostname, **params) click to toggle source
# File lib/net/openvpn/host.rb, line 9
def initialize(hostname, **params)
  @hostname = hostname
  @config = Net::Openvpn::ClientConfig.new(@hostname)

  params.each do |key, value|
    self.send("#{key}=".to_sym, value)
  end
end

Public Instance Methods

exist?() click to toggle source
# File lib/net/openvpn/host.rb, line 48
def exist?
  @config.exists?
end
file() click to toggle source
# File lib/net/openvpn/host.rb, line 26
def file
  @config.path
end
generate_key() click to toggle source
# File lib/net/openvpn/host.rb, line 18
def generate_key

end
generate_ovpn() click to toggle source
# File lib/net/openvpn/host.rb, line 22
def generate_ovpn

end
new?() click to toggle source
# File lib/net/openvpn/host.rb, line 44
def new?
  !@config.exists?
end
path() click to toggle source
# File lib/net/openvpn/host.rb, line 30
def path
  @config.path
end
remove() click to toggle source
# File lib/net/openvpn/host.rb, line 40
def remove
  @config.remove
end
save() click to toggle source
# File lib/net/openvpn/host.rb, line 34
def save
  @config.ip = ip
  @config.network = network
  @config.save
end