Class: S3AssetsDeployer::AssetFile

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_assets_deployer/asset_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, realpath) ⇒ AssetFile

Returns a new instance of AssetFile.



5
6
7
8
# File 'lib/s3_assets_deployer/asset_file.rb', line 5

def initialize(path, realpath)
  @path = path
  @realpath = realpath
end

Instance Method Details

#bodyObject



14
15
16
# File 'lib/s3_assets_deployer/asset_file.rb', line 14

def body
  File.new(@realpath)
end

#content_typeObject



18
19
20
# File 'lib/s3_assets_deployer/asset_file.rb', line 18

def content_type
  MIME::Types.type_for(@path).first.to_s
end

#keyObject



10
11
12
# File 'lib/s3_assets_deployer/asset_file.rb', line 10

def key
  @path
end