Class: Trackman::Assets::RemoteAsset::AssetIO
- Inherits:
-
StringIO
- Object
- StringIO
- Trackman::Assets::RemoteAsset::AssetIO
- Defined in:
- lib/trackman/assets/remote_asset.rb
Instance Attribute Summary collapse
-
#filepath ⇒ Object
Returns the value of attribute filepath.
Instance Method Summary collapse
- #content_type ⇒ Object
-
#initialize(*args) ⇒ AssetIO
constructor
A new instance of AssetIO.
- #original_filename ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(*args) ⇒ AssetIO
Returns a new instance of AssetIO.
44 45 46 47 |
# File 'lib/trackman/assets/remote_asset.rb', line 44 def initialize(*args) super(*args[1..-1]) @filepath = args[0] end |
Instance Attribute Details
#filepath ⇒ Object
Returns the value of attribute filepath.
42 43 44 |
# File 'lib/trackman/assets/remote_asset.rb', line 42 def filepath @filepath end |
Instance Method Details
#content_type ⇒ Object
52 53 54 |
# File 'lib/trackman/assets/remote_asset.rb', line 52 def content_type MIME::Types.type_for(path).to_s end |
#original_filename ⇒ Object
49 50 51 |
# File 'lib/trackman/assets/remote_asset.rb', line 49 def original_filename File.basename(filepath) end |
#path ⇒ Object
55 56 57 |
# File 'lib/trackman/assets/remote_asset.rb', line 55 def path @filepath end |