class Soroban::Walker
An enumerable that allows cells in a range to be visited.
Public Class Methods
new(range, binding)
click to toggle source
Create a new walker from a supplied range and binding. The binding is required when calculating the value of each visited cell.
# File lib/soroban/walker.rb, line 10 def initialize(range, binding) @binding = binding @fc, @fr, @tc, @tr = Soroban::getRange(range) end
Public Instance Methods
each() { |eval("@#{col}#{row}.get", binding)| ... }
click to toggle source
Yield the value of each cell referenced by the supplied range.
# File lib/soroban/walker.rb, line 16 def each (@fc..@tc).each do |col| (@fr..@tr).each do |row| yield eval("@#{col}#{row}.get", @binding) end end end