lib/bamfcsv.rb in bamfcsv-0.0.2 vs lib/bamfcsv.rb in bamfcsv-0.1.0
- old
+ new
@@ -1,13 +1,13 @@
require 'bamfcsv/bamfcsv'
module BAMFCSV
def self.read(thing_to_read)
- if String === thing_to_read
- raise Errno::ENOENT.new("#{thing_to_read} does not exist") unless File.exist? thing_to_read
- raise Errno::EISDIR.new("#{thing_to_read} is a directory") if File.directory? thing_to_read
- read_path(thing_to_read)
- end
+ __parse_string(File.read(thing_to_read))
+ end
+
+ def self.parse(csv_str)
+ __parse_string(csv_str)
end
end