Class: Bizside::CarrierwaveStringIO

Inherits:
StringIO
  • Object
show all
Defined in:
lib/bizside/carrierwave.rb

Instance Attribute Summary collapse

Attributes inherited from StringIO

#base_dir, #fullpath, #md5

Instance Method Summary collapse

Methods inherited from StringIO

#initialize, #original_dirname, #relative_dirname

Constructor Details

This class inherits a constructor from Bizside::StringIO

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



11
12
13
# File 'lib/bizside/carrierwave.rb', line 11

def content_type
  @content_type
end

#file_sizeObject

Returns the value of attribute file_size.



12
13
14
# File 'lib/bizside/carrierwave.rb', line 12

def file_size
  @file_size
end

#original_filenameObject

Returns the value of attribute original_filename.



10
11
12
# File 'lib/bizside/carrierwave.rb', line 10

def original_filename
  @original_filename
end

Instance Method Details

#pathObject



14
15
16
17
18
19
# File 'lib/bizside/carrierwave.rb', line 14

def path
  # Return non-existent path to prevent any actual file/directory from being the target of copy or move
  # because this class does not refer to any file.
  # (CarrierWave::Uploader::Base#cache! tries to copy or move a passed file to its working directory)
  File.join(CarrierWave.tmp_path, SecureRandom.uuid, File.basename(original_filename))
end