module Formatron::S3::Path

defines the S3 bucket keys for consistency

Public Class Methods

key(name:, target:, sub_key:) click to toggle source
# File lib/formatron/s3/path.rb, line 5
def self.key(name:, target:, sub_key:)
  File.join _base_path(
    name: name,
    target: target
  ), sub_key
end
url(region:, bucket:, name:, target:, sub_key:) click to toggle source
# File lib/formatron/s3/path.rb, line 12
def self.url(region:, bucket:, name:, target:, sub_key:)
  key = key(
    name: name,
    target: target,
    sub_key: sub_key
  )
  "https://s3-#{region}.amazonaws.com/#{bucket}/#{key}"
end

Private Class Methods

_base_path(name:, target:) click to toggle source
# File lib/formatron/s3/path.rb, line 21
def self._base_path(name:, target:)
  File.join target, name
end