How can I shift all of these OR statements into something that is done via an array or iterator?
Here’s the long inelegant OR chain:
type = "Open top" if cargo_operation_container_shifting[12] == 1 or cargo_operation_conatiner_shifting[16] ==1 or cargo_operations_container_shifting[99] == 1
(this is a short example)
Here is the progress I have made on making this into an array so far:
open_top_array = [12, 16, 99]
type = "Open top" if open_top_array.each { |n| cargo_operation_container_shifting[n] == 1 }
You the
any?method: