class System::OpenvpnStatusLogReader

Constants

LOGFILE_PATH

Attributes

log_content[RW]

Public Class Methods

new() click to toggle source
# File lib/system/openvpn_status_log_reader.rb, line 14
def initialize
  read_logfile
end
vpn_ip(common_name) click to toggle source
# File lib/system/openvpn_status_log_reader.rb, line 8
def vpn_ip(common_name)
  reader = new
  reader.vpn_ip_for common_name
end

Public Instance Methods

vpn_ip_for(common_name) click to toggle source
# File lib/system/openvpn_status_log_reader.rb, line 18
def vpn_ip_for(common_name)
  status = System::OpenvpnStatusLogParser.new(log_content).status
  status.clients_list[common_name]
end

Private Instance Methods

read_logfile() click to toggle source
# File lib/system/openvpn_status_log_reader.rb, line 25
def read_logfile
  @log_content = File.read(LOGFILE_PATH)
end