Class: AwsTestDump::S3FileRestore

Inherits:
S3BaseProcessor show all
Defined in:
lib/aws_test_dump.rb

Instance Attribute Summary

Attributes inherited from S3BaseProcessor

#bucket_name, #key_name

Instance Method Summary collapse

Methods inherited from S3BaseProcessor

#initialize

Constructor Details

This class inherits a constructor from AwsTestDump::S3BaseProcessor

Instance Method Details

#file_contentsObject



125
126
127
128
129
130
# File 'lib/aws_test_dump.rb', line 125

def file_contents
  if @file_contents.nil?
    @file_contents = File.read(@dump_file)
  end
  @file_contents
end

#restoreObject



132
133
134
135
# File 'lib/aws_test_dump.rb', line 132

def restore
  @s3_client.create_bucket({bucket: @bucket_name})
  @s3_client.put_object({bucket: @bucket_name, key: @key_name, body: file_contents})
end

#runObject



121
122
123
# File 'lib/aws_test_dump.rb', line 121

def run
  restore
end