lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible.rb in eco-helpers-3.0.6 vs lib/eco/api/usecases/graphql/samples/location/service/tree_diff/convertible.rb in eco-helpers-3.0.7

- old
+ new

@@ -6,11 +6,11 @@ # Offers a way to convert the values and keys/headers # of the input csv file/rows module Convertible class << self def included(base) - super(base) + super base.send :include, Inputable end end include Parsing @@ -22,15 +22,18 @@ @input_csv ||= Eco::CSV.read(input_file, encoding: input_encoding).then do |csv| next csv unless header_maps&.any? csv.transform_headers do |name| next name unless header_maps.key?(name) + header_maps[name] end end.then do |csv| transform_input_csv(csv).tap do |res| next if res.is_a?(Eco::CSV::Table) - raise ArgumentError, "Expecting and Eco::CSV::Table. Given: #{res.class}" + + msg = "Expecting and Eco::CSV::Table. Given: #{res.class}" + raise ArgumentError, msg end end end end end