Sha256: 6c6945d4f9fd551aff75b494c149bf7fd2752dba59285f1d87edf6f4a40ba5f9
Contents?: true
Size: 880 Bytes
Versions: 13
Compression:
Stored size: 880 Bytes
Contents
module BrighterPlanet module Purchase module TestImpactVectorsAdapter extend self def key_map @key_map ||= Sector.find(:all, :order => 'io_code').map(&:io_code) end def matrix Matrix[*data] end def data matrix_text = <<-MATRIX | X |111000|3991A0|3991B0|399200|399900|4A0000| |111000|0.81 |0 |0 |0 |0 |0 | |3991A0|0 |0.546 |0 |0 |0 |0 | |3991B0|0 |0 |0.358 |0 |0 |0 | |399200|0 |0 |0 |1.2 |0 |0 | |399900|0 |0 |0 |0 |1.08 |0 | |4A0000|0 |0 |0 |0 |0 |0.623 | MATRIX lines = matrix_text.split(/\n/) lines.shift lines.map do |line| row = line.scan(/[^\s^|]+/).map(&:to_f) row.shift row end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems