I'm attempting to debug a Ruby script, but I am unable to access one method as seen below.
def move_objects(target_folder)
s3_objects.each do |obj|
binding.pry
new_key = s3_folder ? obj.key.sub(s3_folder, target_folder) : "#{target_folder}/#{obj.key}"
obj.put(metadata: { 'new_key' => 'ok' })
obj.move_to(bucket: bucket_name, key: new_key)
end
self
end
When I call the method as so in Rails C:
Courts::Aws::S3Util.new('bucket_name').move_objects(target_folder)
I receive the following error.
NameError: undefined local variable or method `target_folder' for main:Object
What is the appropriate way to access this function to debug and read the new_key data?