class S3Downloader
Constants
- VERSION
Attributes
download_location[R]
Public Class Methods
new()
click to toggle source
# File lib/s3_downloader.rb, line 8 def initialize @s3_bucket_name = 'routes-for-radarr' @file_name = 'api_routes.yml' @s3_bucket_object = Aws::S3::Bucket.new(@s3_bucket_name).object(@file_name) @download_location = "/tmp/#{@file_name}" end
Public Instance Methods
check_for_existing_routes_file()
click to toggle source
# File lib/s3_downloader.rb, line 19 def check_for_existing_routes_file File.exists?(@download_location) end
download_routes()
click to toggle source
# File lib/s3_downloader.rb, line 15 def download_routes @s3_bucket_object.download_file(@download_location) unless check_for_existing_routes_file end