lib/alf/extra/csv.rb in alf-0.10.0 vs lib/alf/extra/csv.rb in alf-0.10.1
- old
+ new
@@ -28,11 +28,14 @@
#
# Returns a CSV instance bound to a given io and options
#
def get_csv(io)
- get_csv_class.new(io, options)
+ csv_class = get_csv_class
+ def_opts = csv_class.const_get(:DEFAULT_OPTIONS)
+ csv_opts = options.delete_if{|k,v| !def_opts.has_key?(k)}
+ csv_class.new(io, csv_opts)
end
end # module Commons
#
@@ -99,6 +102,6 @@
::Alf::Reader.register(:csv, [".csv"], self)
end # class Reader
end # module CSV
-end # module Alf
\ No newline at end of file
+end # module Alf