Class: SimpleEtl::Source::ParseResult
- Inherits:
-
Object
- Object
- SimpleEtl::Source::ParseResult
- Defined in:
- lib/simple_etl/source/parse_result.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
- #append_error(row_index, message, e) ⇒ Object
- #append_row(attributes) ⇒ Object
-
#initialize ⇒ ParseResult
constructor
A new instance of ParseResult.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ ParseResult
Returns a new instance of ParseResult.
8 9 10 11 |
# File 'lib/simple_etl/source/parse_result.rb', line 8 def initialize @errors = [] @rows = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/simple_etl/source/parse_result.rb', line 6 def errors @errors end |
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
6 7 8 |
# File 'lib/simple_etl/source/parse_result.rb', line 6 def rows @rows end |
Instance Method Details
#append_error(row_index, message, e) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/simple_etl/source/parse_result.rb', line 19 def append_error row_index, , e @errors << OpenStruct.new({ :row_index => row_index, :message => , :exception => e }) end |
#append_row(attributes) ⇒ Object
15 16 17 |
# File 'lib/simple_etl/source/parse_result.rb', line 15 def append_row attributes @rows << Row.new(attributes) end |
#valid? ⇒ Boolean
13 |
# File 'lib/simple_etl/source/parse_result.rb', line 13 def valid?; @errors.empty?; end |