Class: S3AssetDeploy::LocalAsset
- Inherits:
-
Object
- Object
- S3AssetDeploy::LocalAsset
- Defined in:
- lib/s3_asset_deploy/local_asset.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #==(other_asset) ⇒ Object
- #full_path ⇒ Object
-
#initialize(path, remove_fingerprint: nil) ⇒ LocalAsset
constructor
A new instance of LocalAsset.
- #mime_type ⇒ Object
- #original_path ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(path, remove_fingerprint: nil) ⇒ LocalAsset
Returns a new instance of LocalAsset.
8 9 10 11 |
# File 'lib/s3_asset_deploy/local_asset.rb', line 8 def initialize(path, remove_fingerprint: nil) @path = path @remove_fingerprint = remove_fingerprint end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/s3_asset_deploy/local_asset.rb', line 6 def path @path end |
Instance Method Details
#==(other_asset) ⇒ Object
30 31 32 |
# File 'lib/s3_asset_deploy/local_asset.rb', line 30 def ==(other_asset) path == other_asset.path end |
#full_path ⇒ Object
22 23 24 |
# File 'lib/s3_asset_deploy/local_asset.rb', line 22 def full_path File.join(ENV["PWD"], "public", path) end |
#mime_type ⇒ Object
26 27 28 |
# File 'lib/s3_asset_deploy/local_asset.rb', line 26 def mime_type S3AssetDeploy::AssetHelper.mime_type_for_path(path).to_s end |
#original_path ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/s3_asset_deploy/local_asset.rb', line 13 def original_path @original_path ||= if @remove_fingerprint @remove_fingerprint.call(path) else S3AssetDeploy::AssetHelper.remove_fingerprint(path) end end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/s3_asset_deploy/local_asset.rb', line 34 def to_s path end |