Class: Trackman::Assets::RemoteAsset::AssetIO

Inherits:
StringIO
  • Object
show all
Defined in:
lib/trackman/assets/remote_asset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filepathObject

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_typeObject



52
53
54
# File 'lib/trackman/assets/remote_asset.rb', line 52

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

#original_filenameObject



49
50
51
# File 'lib/trackman/assets/remote_asset.rb', line 49

def original_filename
  File.basename(filepath)
end

#pathObject



55
56
57
# File 'lib/trackman/assets/remote_asset.rb', line 55

def path
  @filepath
end