Sha256: a7245601c6a83e8dee430b32f00d374617f4ebca934f1baee0abaa197f925b2d
Contents?: true
Size: 511 Bytes
Versions: 3
Compression:
Stored size: 511 Bytes
Contents
require "matrix" module FlexStationData class Wells attr_reader :matrix def initialize(matrix) @matrix = matrix end def values(well_label) matrix[*coordinates(well_label)] end def coordinates(well_label) coordinates_index[well_label] ||= begin row, column = well_label.scan(/\A([A-Z])(\d+)\z/).first [ row.ord - "A".ord, column.to_i - 1 ] end end private def coordinates_index @coordinates_index ||= {} end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
flex-station-data-1.0.1 | lib/flex_station_data/wells.rb |
flex-station-data-1.0.0 | lib/flex_station_data/wells.rb |
flex-station-data-0.3.2 | lib/flex_station_data/wells.rb |