lib/components/captcha.rb in rad_kit-0.0.8 vs lib/components/captcha.rb in rad_kit-0.0.9
- old
+ new
@@ -1,11 +1,11 @@
class Rad::Captcha
attr_accessor :public_key, :private_key, :timeout, :enabled, :verify_url
- attr_required :private_key, :public_key
+ attr_required :private_key, :public_key
def enabled?; !!enabled end
-
- def verify request, params
+
+ def verify request, params
recaptcha = nil
Timeout::timeout(timeout || 3) do
recaptcha = Net::HTTP.post_form URI.parse(verify_url), {
'privatekey' => private_key,
'remoteip' => request.ip,
@@ -17,8 +17,8 @@
answer, error = result
answer == 'true'
end
end
-rad.register :captcha, depends_on: [:template, :controller] do
+rad.register :captcha, depends_on: [:template, :controller] do
Rad::Captcha.new
end
\ No newline at end of file