Class: Sxn::Security::SecureFileCopier::CopyResult

Inherits:
Object
  • Object
show all
Defined in:
lib/sxn/security/secure_file_copier.rb

Overview

File operation result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_path, destination_path, operation, encrypted: false, checksum: nil, duration: 0) ⇒ CopyResult

Returns a new instance of CopyResult.



23
24
25
26
27
28
29
30
# File 'lib/sxn/security/secure_file_copier.rb', line 23

def initialize(source_path, destination_path, operation, encrypted: false, checksum: nil, duration: 0)
  @source_path = source_path
  @destination_path = destination_path
  @operation = operation
  @encrypted = encrypted
  @checksum = checksum
  @duration = duration
end

Instance Attribute Details

#checksumObject (readonly)

Returns the value of attribute checksum.



21
22
23
# File 'lib/sxn/security/secure_file_copier.rb', line 21

def checksum
  @checksum
end

#destination_pathObject (readonly)

Returns the value of attribute destination_path.



21
22
23
# File 'lib/sxn/security/secure_file_copier.rb', line 21

def destination_path
  @destination_path
end

#durationObject (readonly)

Returns the value of attribute duration.



21
22
23
# File 'lib/sxn/security/secure_file_copier.rb', line 21

def duration
  @duration
end

#encryptedObject (readonly)

Returns the value of attribute encrypted.



21
22
23
# File 'lib/sxn/security/secure_file_copier.rb', line 21

def encrypted
  @encrypted
end

#operationObject (readonly)

Returns the value of attribute operation.



21
22
23
# File 'lib/sxn/security/secure_file_copier.rb', line 21

def operation
  @operation
end

#source_pathObject (readonly)

Returns the value of attribute source_path.



21
22
23
# File 'lib/sxn/security/secure_file_copier.rb', line 21

def source_path
  @source_path
end

Instance Method Details

#to_hObject



32
33
34
35
36
37
38
39
40
41
# File 'lib/sxn/security/secure_file_copier.rb', line 32

def to_h
  {
    source_path: @source_path,
    destination_path: @destination_path,
    operation: @operation,
    encrypted: @encrypted,
    checksum: @checksum,
    duration: @duration
  }
end