Class: Bricolage::S3Writer

Inherits:
Object
  • Object
show all
Defined in:
lib/bricolage/s3writer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ds, key) ⇒ S3Writer

Returns a new instance of S3Writer.



3
4
5
6
# File 'lib/bricolage/s3writer.rb', line 3

def initialize(ds, key)
  @ds = ds
  @key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



12
13
14
# File 'lib/bricolage/s3writer.rb', line 12

def key
  @key
end

Instance Method Details

#objectObject



14
15
16
# File 'lib/bricolage/s3writer.rb', line 14

def object
  @object ||= @ds.object(@key)
end

#upload(path) ⇒ Object



18
19
20
# File 'lib/bricolage/s3writer.rb', line 18

def upload(path)
  object.upload_file(path)
end

#urlObject



8
9
10
# File 'lib/bricolage/s3writer.rb', line 8

def url
  @url ||= @ds.url(@key)
end