Class: Refile::FileDouble

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/refile/file_double.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, name = nil, content_type: nil) ⇒ FileDouble

Returns a new instance of FileDouble.



4
5
6
7
8
# File 'lib/refile/file_double.rb', line 4

def initialize(data, name = nil, content_type: nil)
  @io = StringIO.new(data)
  @original_filename = name
  @content_type = content_type
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



3
4
5
# File 'lib/refile/file_double.rb', line 3

def content_type
  @content_type
end

#original_filenameObject (readonly)

Returns the value of attribute original_filename.



3
4
5
# File 'lib/refile/file_double.rb', line 3

def original_filename
  @original_filename
end