--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Creates a corresponding DiscreteMediaType subclass object for the given <tt>file</tt> based on <tt>file</tt>'s filename extension. <tt>file</tt> can be a file path or File object.
- !ruby/struct:SM::Flow::P 
  body: <tt>content_type</tt> can be specified in order to override the auto detected content type. If the <tt>content_type</tt> cannot be detected, an UnknownContentError exception will be raised.
- !ruby/struct:SM::Flow::P 
  body: Creates and sets the singleton method <tt>path</tt> on the created object. The <tt>path</tt> method is utilized by other methods in the MIME library, therefore, eliminating redundant and explicit filename assignments.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Comparison Example
- !ruby/struct:SM::Flow::VERB 
  body: " entity1 = open('/tmp/file1.txt')\n entity2 = DiscreteMediaFactory.create('/tmp/file2.txt')\n\n mixed_msg = Multipart::Mixed.new\n mixed_msg.attach_entity(entity1.read, entity.path)\n mixed_msg.attach_entity(entity2) # no path needed\n"
full_name: MIME::DiscreteMediaFactory::create
is_singleton: true
name: create
params: (file, content_type = nil)
visibility: public
