Class: PTJ::Parser::PassThreeColons
- Inherits:
-
FileParser
- Object
- FileParser
- PTJ::Parser::PassThreeColons
- Defined in:
- lib/ptj/parser/fileparser/passthreecolons.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: something :
- pass :
- something something :
- pass :
- something something :
- pass :
-
something.
Instance Method Details
#parse_line(line) ⇒ Object
Expecting the following format:
- something :
- pass :
-
something
- something :
- pass :
-
something
- something :
- pass :
-
something
16 17 18 19 20 21 22 |
# File 'lib/ptj/parser/fileparser/passthreecolons.rb', line 16 def parse_line(line) if line =~ /\s*\S*\s*:::\s*(\S+)\s*:::/ pass = $~[1] hash = nil end {:mypass => pass, :myhash => hash} end |