Class: TubeRackWalking::Walker

Inherits:
Object
  • Object
show all
Defined in:
app/models/tube_rack_walking.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Constructor Details

#initialize(rack) ⇒ Walker

Returns a new instance of Walker.



9
10
11
12
13
# File 'app/models/tube_rack_walking.rb', line 9

def initialize(rack)
  indexed_tubes =
    rack.racked_tubes.each_with_object({}) { |racked_tube, store| store[racked_tube.coordinate] = racked_tube.tube }
  @rows = rack.rows_range.index_with { |row| rack.columns_range.map { |column| indexed_tubes["#{row}#{column}"] } }
end