app/models/attachment.rb
# Returns whether this is a standard web image.
# Takes a conservative view that only PNGs, JP(E)Gs and GIFs qualify.
#
# @return [true, false]
Returns whether this is a standard web image.
Takes a conservative view that only PNGs, JP(E)Gs and GIFs qualify.
Returns whether this is a standard web image . Takes a conservative view that only PNGs JP ( E ) Gs and GIFs qualify .
def web_image?
    %w(png jpg jpeg gif).each do |sub_type|
      return true if Rack::Mime.match?(mime_type, "image/#{sub_type}")
    end
    false
  end
def web_image? %w( png jpg jpeg gif ) . each do | sub_type | return true if Rack :: Mime . match? ( mime_type , "image/#{sub_type}" ) end false end
Returns whether this is a standard web image.
Returns whether this is a standard web image .
None
true, false