Sha256: 591e0ef0236389cc959b6f18d56770af8f80f1ca20e5f08599ed49ec7ddae0ed
Contents?: true
Size: 533 Bytes
Versions: 10
Compression:
Stored size: 533 Bytes
Contents
module CsvImportMagic module Models def csv_import_magic(options) define_method(:csv_parser_names) do names_of_parsers = {} options.each do |key, _value| names_of_parsers["#{key}_parser"] = "#{key.to_s.classify}Parser".constantize end names_of_parsers end define_singleton_method(:csv_parser_default_name) { "#{name.to_s.underscore}_parser" } define_singleton_method(:columns_names) { |param| options[param.to_s.remove('_parser').to_sym] } end end end
Version data entries
10 entries across 10 versions & 1 rubygems