Hi,
My problem is fairly straightforward. I'm trying to read the contents
of a existing text file on S3 into a local ruby string.
I'm looking at the docs, but cannot figure out the answer (http://
rubydoc.info/gems/fog/0.11.0/Fog/Storage/AWS/File).
I tried this:
connection = Fog::Storage.new({
:provider => 'AWS',
:aws_access_key_id => "my_access_key",
:aws_secret_access_key => "my_secret_key"
})
directory =
connection.directories.new(:key =>
"my_S3_top_directory")
file =
directory.files.new(:key =>
'path_to_existing_file_on_S3')
file_contents = file.body # <=== EMPTY STRING
Am I misusing the 'new' method? Is the 'body' method the wrong one to
use in this case?
Thanks!