Sha256: f1d83359ae3da07e36fb6712794d5e5d514d7d636724e1b34c8d52e13ec295c5
Contents?: true
Size: 529 Bytes
Versions: 11
Compression:
Stored size: 529 Bytes
Contents
module Eeml class CsvParserV1 def self.make_environment_from_csv(csv_content) csv = LightCsv.parse(strip_content(csv_content)) environment = Environment.new(:csv_version => 'v1') raise(CsvEncodingError, "Currently Pachube can only accept csv for your most recent set of values. You have submitted #{csv.size} rows of data.") unless csv.size == 1 environment.add_datastreams(csv.first.collect { |datastream_value| DataStream.new(:value => datastream_value) }) environment end end end
Version data entries
11 entries across 11 versions & 1 rubygems