Class: S3diff::S3File

Inherits:
Object
  • Object
show all
Defined in:
lib/s3diff/s3_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(s3_uri, s3_client) ⇒ S3File

Returns a new instance of S3File.



6
7
8
9
# File 'lib/s3diff/s3_file.rb', line 6

def initialize(s3_uri, s3_client)
  @s3c = s3_client
  @uri = s3_uri
end

Instance Method Details

#etagObject



11
12
13
# File 'lib/s3diff/s3_file.rb', line 11

def etag
  head.etag.delete(%(")) if exist?
end

#exist?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/s3diff/s3_file.rb', line 27

def exist?
  !head.nil?
end

#original_pathObject



23
24
25
# File 'lib/s3diff/s3_file.rb', line 23

def original_path
  @uri
end

#pathObject



19
20
21
# File 'lib/s3diff/s3_file.rb', line 19

def path
  cache_file.path
end

#sizeObject



15
16
17
# File 'lib/s3diff/s3_file.rb', line 15

def size
  head.content_length if exist?
end