Class: UniversalAccessLogParser::ElementGroup::Root
- Inherits:
-
Integrating
- Object
- Array
- UniversalAccessLogParser::ElementGroup
- Integrating
- UniversalAccessLogParser::ElementGroup::Root
- Defined in:
- lib/universal-access-log-parser.rb
Instance Attribute Summary collapse
-
#skip_lines ⇒ Object
readonly
Returns the value of attribute skip_lines.
Attributes inherited from Integrating
Instance Method Summary collapse
-
#initialize(separator, &block) ⇒ Root
constructor
A new instance of Root.
- #names ⇒ Object
- #parsers ⇒ Object
- #regexp ⇒ Object
-
#skip_line(regexp) ⇒ Object
root specific DSL.
Methods inherited from UniversalAccessLogParser::ElementGroup
#date, #date_iis, #date_ncsa, #double_quoted, #element, #float, #integer, #integratin_group, #ip, #optional, parser, #separated_with, #separator, #single_quoted, #string, #surrounded_by, #surrounding_group
Constructor Details
#initialize(separator, &block) ⇒ Root
Returns a new instance of Root.
56 57 58 59 |
# File 'lib/universal-access-log-parser.rb', line 56 def initialize(separator, &block) @skip_lines = [] super(nil, separator, &block) end |
Instance Attribute Details
#skip_lines ⇒ Object (readonly)
Returns the value of attribute skip_lines.
61 62 63 |
# File 'lib/universal-access-log-parser.rb', line 61 def skip_lines @skip_lines end |
Instance Method Details
#names ⇒ Object
67 68 69 |
# File 'lib/universal-access-log-parser.rb', line 67 def names super << :other end |
#parsers ⇒ Object
71 72 73 74 75 76 |
# File 'lib/universal-access-log-parser.rb', line 71 def parsers super << lambda{ |s| return nil if s.empty? s.sub(Regexp.new("^#{separator}"), '') } end |
#regexp ⇒ Object
63 64 65 |
# File 'lib/universal-access-log-parser.rb', line 63 def regexp super + "(|#{separator}.*)" end |
#skip_line(regexp) ⇒ Object
root specific DSL
79 80 81 |
# File 'lib/universal-access-log-parser.rb', line 79 def skip_line(regexp) @skip_lines << regexp end |