Class: ETL::Parser::Parser
- Inherits:
-
Object
- Object
- ETL::Parser::Parser
- Includes:
- Enumerable
- Defined in:
- lib/etl/parser/parser.rb
Overview
Base parser class. Implementation classes must extend this class and implement the each method. The each method should return each row of the source data as a Hash.
Direct Known Subclasses
ApacheCombinedLogParser, DelimitedParser, FixedWidthParser, SaxParser, XmlParser
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Options Hash for the parser.
-
#source ⇒ Object
readonly
The Source object for the data.
Class Method Summary collapse
-
.class_for_name(name) ⇒ Object
Convert the name (string or symbol) to a parser class.
Instance Method Summary collapse
-
#initialize(source, options = {}) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(source, options = {}) ⇒ Parser
Returns a new instance of Parser.
24 25 26 27 |
# File 'lib/etl/parser/parser.rb', line 24 def initialize(source, ={}) @source = source @options = || {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Options Hash for the parser
22 23 24 |
# File 'lib/etl/parser/parser.rb', line 22 def @options end |
#source ⇒ Object (readonly)
The Source object for the data
19 20 21 |
# File 'lib/etl/parser/parser.rb', line 19 def source @source end |