Class: S3AssetsDeployer::AssetFile
- Inherits:
-
Object
- Object
- S3AssetsDeployer::AssetFile
- Defined in:
- lib/s3_assets_deployer/asset_file.rb
Instance Attribute Summary collapse
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
- #body ⇒ Object
- #content_type ⇒ Object
-
#initialize(prefix, path) ⇒ AssetFile
constructor
A new instance of AssetFile.
- #key ⇒ Object
Constructor Details
#initialize(prefix, path) ⇒ AssetFile
Returns a new instance of AssetFile.
7 8 9 10 |
# File 'lib/s3_assets_deployer/asset_file.rb', line 7 def initialize(prefix, path) @prefix = prefix @path = path end |
Instance Attribute Details
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
5 6 7 |
# File 'lib/s3_assets_deployer/asset_file.rb', line 5 def prefix @prefix end |
Instance Method Details
#body ⇒ Object
16 17 18 |
# File 'lib/s3_assets_deployer/asset_file.rb', line 16 def body File.new(@path) end |
#content_type ⇒ Object
20 21 22 |
# File 'lib/s3_assets_deployer/asset_file.rb', line 20 def content_type MIME::Types.type_for(@path).first.to_s end |
#key ⇒ Object
12 13 14 |
# File 'lib/s3_assets_deployer/asset_file.rb', line 12 def key [prefix, File.basename(@path)].join('/') end |