Class: AssetFormat
- Inherits:
-
Object
- Object
- AssetFormat
- Defined in:
- app/models/asset_format.rb
Defined Under Namespace
Instance Method Summary collapse
Instance Method Details
#content_type ⇒ Object
2 3 4 |
# File 'app/models/asset_format.rb', line 2 def content_type self.class::CONTENT_TYPE || 'text/plain' end |
#log ⇒ Object
18 19 20 |
# File 'app/models/asset_format.rb', line 18 def log status == 200 ? ('read ' + @path) : ('error: ' + @text || '') end |
#status ⇒ Object
14 15 16 |
# File 'app/models/asset_format.rb', line 14 def status @status || 200 end |
#text ⇒ Object
6 7 8 9 10 11 12 |
# File 'app/models/asset_format.rb', line 6 def text if defined?(@path) File.read(@path) else @text || '' end end |