Class: S3Archive::LocalFile

Inherits:
Struct
  • Object
show all
Includes:
Logging
Defined in:
lib/s3archive/s3_file_synchronizer.rb

Overview

Just a wrapper around a path with some md5 functions

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

#logger

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



39
40
41
# File 'lib/s3archive/s3_file_synchronizer.rb', line 39

def path
  @path
end

Instance Method Details

#md5Object



54
55
56
# File 'lib/s3archive/s3_file_synchronizer.rb', line 54

def md5
  @md5 ||= Digest::MD5.file(path)
end

#md5_base64Object



50
51
52
# File 'lib/s3archive/s3_file_synchronizer.rb', line 50

def md5_base64
  md5.base64digest
end

#md5_hexObject



46
47
48
# File 'lib/s3archive/s3_file_synchronizer.rb', line 46

def md5_hex
  md5.hexdigest
end

#open(*args, &block) ⇒ Object



42
43
44
# File 'lib/s3archive/s3_file_synchronizer.rb', line 42

def open(*args, &block)
  File.open(path, *args, &block)
end

#to_sObject



58
59
60
# File 'lib/s3archive/s3_file_synchronizer.rb', line 58

def to_s
  path
end