Class: TestServer::FileUpload

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Naming
Includes:
ActiveModel::Conversion, ActiveModel::Validations
Defined in:
app/models/test_server/file_upload.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ FileUpload

Returns a new instance of FileUpload.



10
11
12
13
14
# File 'app/models/test_server/file_upload.rb', line 10

def initialize(attributes = {})
  Hash(attributes).each do |name, value|
    send("#{name}=", value)
  end
end

Instance Attribute Details

#checksum_calculationObject (readonly)

Returns the value of attribute checksum_calculation.



8
9
10
# File 'app/models/test_server/file_upload.rb', line 8

def checksum_calculation
  @checksum_calculation
end

#filetype_detectionObject (readonly)

Returns the value of attribute filetype_detection.



8
9
10
# File 'app/models/test_server/file_upload.rb', line 8

def filetype_detection
  @filetype_detection
end

#virus_scanObject (readonly)

Returns the value of attribute virus_scan.



8
9
10
# File 'app/models/test_server/file_upload.rb', line 8

def virus_scan
  @virus_scan
end

Instance Method Details

#persisted?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/test_server/file_upload.rb', line 37

def persisted?
  false
end

#uploaded_fileObject



33
34
35
# File 'app/models/test_server/file_upload.rb', line 33

def uploaded_file
  @uploaded_file || UploadedFile.new(nil)
end

#uploaded_file=(file) ⇒ Object



29
30
31
# File 'app/models/test_server/file_upload.rb', line 29

def uploaded_file=(file)
  @uploaded_file = UploadedFile.new(file)
end