Class: Image

Inherits:
NodeEntityAbstract show all
Defined in:
app/models/image.rb

Instance Method Summary collapse

Methods inherited from NodeEntityAbstract

_find, #attributes=, find, #initialize, #node

Constructor Details

This class inherits a constructor from NodeEntityAbstract

Instance Method Details

#content_typeObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/models/image.rb', line 3

def content_type
  case name
  when /\.png$/i
    'image/png'
  when /\.jpeg$|\.jpg$/i
    'image/jpeg'
  when /\.gif$/i
    'image/gif'
  when /\.tiff?$/i
    'image/tiff'
  when /\.xwd?$/i
    'image/xwindowdump'
  else
    raise "#{name} Not a image file or unsupported image type (which can be easily extended. Contact the gfdnavi developpers.)"
  end
end