Module: Csvbuilder::Import::Base
- Extended by:
- ActiveSupport::Concern
- Included in:
- Csvbuilder::Import
- Defined in:
- lib/csvbuilder/importer/concerns/import/base.rb
Instance Method Summary collapse
-
#abort? ⇒ Boolean
Safe to override.
-
#free_previous ⇒ Object
Free ‘previous` from memory to avoid making a linked list.
- #initialize(source_row_or_exception = [], options = {}) ⇒ Object
-
#skip? ⇒ Boolean
Safe to override.
Instance Method Details
#abort? ⇒ Boolean
Safe to override.
53 54 55 |
# File 'lib/csvbuilder/importer/concerns/import/base.rb', line 53 def abort? false end |
#free_previous ⇒ Object
Free ‘previous` from memory to avoid making a linked list
38 39 40 41 |
# File 'lib/csvbuilder/importer/concerns/import/base.rb', line 38 def free_previous attributes @previous = nil end |
#initialize(source_row_or_exception = [], options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/csvbuilder/importer/concerns/import/base.rb', line 21 def initialize(source_row_or_exception = [], = {}) @source_row = source_row_or_exception @csv_exception = source_row if source_row.is_a? Exception @source_row = [] if source_row_or_exception.class != Array @line_number = [:line_number] @index = [:index] @source_headers = [:source_headers] @previous = [:previous].try(:dup) previous.try(:free_previous) super() end |
#skip? ⇒ Boolean
Safe to override.
46 47 48 |
# File 'lib/csvbuilder/importer/concerns/import/base.rb', line 46 def skip? !valid? end |