Class: Processor::Subroutine::Counter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/processor/subroutine/counter.rb

Instance Method Summary collapse

Instance Method Details

#processObject



6
7
8
9
# File 'lib/processor/subroutine/counter.rb', line 6

def process(*)
  super
  record_processed
end

#processed_records_countObject



15
16
17
# File 'lib/processor/subroutine/counter.rb', line 15

def processed_records_count
  @processed_records_count ||= 0
end

#remaining_records_countObject



11
12
13
# File 'lib/processor/subroutine/counter.rb', line 11

def remaining_records_count
  [ total_records - processed_records_count, 0 ].max
end