class Tools::TextToArray
Attributes
output[RW]
Public Class Methods
new(filename)
click to toggle source
# File lib/decay_heat_with_nuclear/tools.rb, line 5 def initialize(filename) @output = {} ts = [] t0 = [] power = [] f = File.open("#{filename}", 'r') f.each_line do |line| a, b, c = line.split("\t") ts << a.to_f t0 << b.to_f power << c.to_f end f.close @output = { ts: ts, t0: t0, power: power } end