Class: System::OpenvpnStatusLogParser
- Inherits:
-
Object
- Object
- System::OpenvpnStatusLogParser
- Defined in:
- lib/system/openvpn_status_log_parser.rb
Instance Attribute Summary collapse
-
#clients_block ⇒ Object
Returns the value of attribute clients_block.
-
#status ⇒ Object
Returns the value of attribute status.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text) ⇒ OpenvpnStatusLogParser
constructor
A new instance of OpenvpnStatusLogParser.
- #parse ⇒ Object
Constructor Details
#initialize(text) ⇒ OpenvpnStatusLogParser
Returns a new instance of OpenvpnStatusLogParser.
5 6 7 8 9 10 |
# File 'lib/system/openvpn_status_log_parser.rb', line 5 def initialize(text) @status = System::OpenvpnStatus.new @clients_block = false @text = text parse end |
Instance Attribute Details
#clients_block ⇒ Object
Returns the value of attribute clients_block.
3 4 5 |
# File 'lib/system/openvpn_status_log_parser.rb', line 3 def clients_block @clients_block end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/system/openvpn_status_log_parser.rb', line 3 def status @status end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/system/openvpn_status_log_parser.rb', line 3 def text @text end |
Instance Method Details
#parse ⇒ Object
12 13 14 15 16 17 |
# File 'lib/system/openvpn_status_log_parser.rb', line 12 def parse @text.lines.each do |line| line_tokens = line.strip.split(',') parse_client_virtual_ips(line_tokens) end end |