Class: Batching::Batch

Inherits:
Array
  • Object
show all
Defined in:
lib/batching.rb

Overview

Purpose adds start_index to Array

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#start_indexObject

Returns the value of attribute start_index.



5
6
7
# File 'lib/batching.rb', line 5

def start_index
  @start_index
end

Instance Method Details

#end_indexObject



7
8
9
10
11
# File 'lib/batching.rb', line 7

def end_index
  return nil if size.zero?

  start_index + size - 1
end