Class: Comfy::Cms::File

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/comfy/cms/file.rb

Constant Summary collapse

IMAGE_MIMETYPES =
%w(gif jpeg pjpeg png tiff).collect{|subtype| "image/#{subtype}"}

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dimensionsObject

Returns the value of attribute dimensions.



8
9
10
# File 'app/models/comfy/cms/file.rb', line 8

def dimensions
  @dimensions
end

Instance Method Details

#is_image?Boolean

– Instance Methods —————————————————–

Returns:

  • (Boolean)


47
48
49
# File 'app/models/comfy/cms/file.rb', line 47

def is_image?
  IMAGE_MIMETYPES.include?(file_content_type)
end