Class: AssetFormat

Inherits:
Object
  • Object
show all
Defined in:
app/models/asset_format.rb

Direct Known Subclasses

Css, Js

Defined Under Namespace

Classes: Css, Js

Instance Method Summary collapse

Instance Method Details

#content_typeObject



2
3
4
# File 'app/models/asset_format.rb', line 2

def content_type
  self.class::CONTENT_TYPE || 'text/plain'
end

#logObject



18
19
20
# File 'app/models/asset_format.rb', line 18

def log
  status == 200 ? ('read ' + @path) : ('error: ' + @text || '')
end

#statusObject



14
15
16
# File 'app/models/asset_format.rb', line 14

def status
  @status || 200
end

#textObject



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