Class: PTJ::Parser::CountPassOnly
- Inherits:
-
FileParser
- Object
- FileParser
- PTJ::Parser::CountPassOnly
- Defined in:
- lib/ptj/parser/fileparser/countpassonly.rb
Overview
FileParser class which allows you to parse a file line by line.
Instance Method Summary collapse
-
#parse_line(line) ⇒ Object
Expecting the following format: pass, hash pass, hash pass, hash.
Instance Method Details
#parse_line(line) ⇒ Object
Expecting the following format: pass, hash pass, hash pass, hash
16 17 18 19 20 21 22 23 |
# File 'lib/ptj/parser/fileparser/countpassonly.rb', line 16 def parse_line(line) if line =~ /^\s*(\d+)\s*(\S+)\s*$/ count = $~[1] pass = $~[2] hash = nil end {:mypass => pass, :myhash => hash, :count => count} end |