Module: UberS3::Operation::Object::ContentType::InstanceMethods

Defined in:
lib/uber-s3/operation/object/content_type.rb

Instance Method Summary collapse

Instance Method Details

#content_typeObject



26
# File 'lib/uber-s3/operation/object/content_type.rb', line 26

def content_type;         @content_type;              end

#content_type=(x) ⇒ Object



25
# File 'lib/uber-s3/operation/object/content_type.rb', line 25

def content_type=(x);     @content_type = x;          end

#infer_content_type!Object



18
19
20
21
22
23
# File 'lib/uber-s3/operation/object/content_type.rb', line 18

def infer_content_type!
  mime_type = MIME::Types.type_for(key).first

  self.content_type ||= mime_type.content_type if mime_type
  self.content_type ||= 'binary/octet-stream'
end