Module: Formatron::S3::Path

Defined in:
lib/formatron/s3/path.rb

Overview

defines the S3 bucket keys for consistency

Class Method Summary collapse

Class Method Details

.key(name:, target:, sub_key:) ⇒ Object



5
6
7
8
9
10
# 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:) ⇒ Object



12
13
14
15
16
17
18
19
# 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