Class: Decaptcha::Provider::Base

Inherits:
Object
  • Object
show all
Includes:
Error
Defined in:
lib/decaptcha/provider/base.rb

Direct Known Subclasses

DeathByCaptcha::Base

Instance Method Summary collapse

Instance Method Details

#mime_type(filename) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
# File 'lib/decaptcha/provider/base.rb', line 6

def mime_type(filename)
  filename = File.basename(filename)
  
  if filename =~  /.jp(e)g$/
    "image/jpeg"
  elsif filename =~  /.png$/
    "image/png"
  elsif filename =~  /.gif$/
    "image/gif"
  end
end