Class: Processor::Data::NullProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/processor/data/null_processor.rb

Direct Known Subclasses

ArrayProcessor, BatchProcessor, CsvProcessor

Instance Method Summary collapse

Instance Method Details

#nameObject



16
17
18
19
20
21
22
23
# File 'lib/processor/data/null_processor.rb', line 16

def name
  # underscore a class name
  self.class.name.to_s.
    gsub(/::/, '_').
    gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
    gsub(/([a-z\d])([A-Z])/,'\1_\2').
    downcase
end

#process(record) ⇒ Object



4
5
6
# File 'lib/processor/data/null_processor.rb', line 4

def process(record)
  # do nothing
end

#recordsObject



8
9
10
# File 'lib/processor/data/null_processor.rb', line 8

def records
  []
end

#total_recordsObject



12
13
14
# File 'lib/processor/data/null_processor.rb', line 12

def total_records
  @total_records ||= records.count
end