Class: Pal::Operation::CSVProcessor
- Inherits:
-
Object
- Object
- Pal::Operation::CSVProcessor
- Includes:
- Log
- Defined in:
- lib/pal/handler/processor.rb
Overview
Base class for CSV impls, we can define strategy on memory usage needs based on potential issues from file size. TODO: We probably want to break away from this being a “CSV”-only file type later Needs more thinking
Direct Known Subclasses
Instance Attribute Summary collapse
-
#csv_file_location ⇒ Object
Returns the value of attribute csv_file_location.
Class Method Summary collapse
-
.retrieve_default_processor(csv_file_location) ⇒ BaseCSVProcessor
Strategy to return correct type - memory or performance focused.
Instance Method Summary collapse
-
#initialize(csv_file_location) ⇒ CSVProcessor
constructor
A new instance of CSVProcessor.
- #parse(ctx, opts = {}, &block) ⇒ Object
Methods included from Log
#log_debug, #log_error, #log_info, #log_warn
Constructor Details
#initialize(csv_file_location) ⇒ CSVProcessor
Returns a new instance of CSVProcessor.
25 26 27 |
# File 'lib/pal/handler/processor.rb', line 25 def initialize(csv_file_location) @csv_file_location = csv_file_location end |
Instance Attribute Details
#csv_file_location ⇒ Object
Returns the value of attribute csv_file_location.
23 24 25 |
# File 'lib/pal/handler/processor.rb', line 23 def csv_file_location @csv_file_location end |
Class Method Details
.retrieve_default_processor(csv_file_location) ⇒ BaseCSVProcessor
Strategy to return correct type - memory or performance focused.
18 19 20 21 |
# File 'lib/pal/handler/processor.rb', line 18 def self.retrieve_default_processor(csv_file_location) Pal.logger.info("Default processor has been requested. No further action required.") RCSVProcessorImpl.new(csv_file_location) end |
Instance Method Details
#parse(ctx, opts = {}, &block) ⇒ Object
32 33 34 |
# File 'lib/pal/handler/processor.rb', line 32 def parse(ctx, opts={}, &block) _parse_impl(ctx, opts, &block) end |