# File multipart.rb, line 49 def initialize(filepath_or_io, mimetype='application/octet-stream', filename=nil) @mimetype = mimetype @filename = nil if filepath_or_io.respond_to? :read @input = filepath_or_io @shouldclose = false # came opened if filepath_or_io.respond_to? :path @filename = File.basename(filepath_or_io.path) end else @input = File.open(filepath_or_io, 'rb') @shouldclose = true # I opened it @filename = File.basename(filepath_or_io) end end