Module: Guardian

Defined in:
lib/guardian.rb,
lib/guardian/engine.rb,
lib/guardian/version.rb

Defined Under Namespace

Classes: Engine

Constant Summary collapse

VERSION =
"0.5.1"

Instance Method Summary collapse

Instance Method Details

#guard(vars = { :threshold => 2}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/guardian.rb', line 7

def guard(vars = { :threshold => 2})
  if params[:duration] && params[:duration].to_i < vars[:threshold]
    logger.info "\n"
    logger.info "+++++++++++++++++++++++++++++++++++++"
    logger.info "GUARDIAN IS REJECTION FORM SUBMISSION"
    logger.info "Page duration: #{params[:duration]}"
    logger.info "Threhold: #{vars[:threshold]}"
    logger.info "+++++++++++++++++++++++++++++++++++++"
    logger.info "\n"
  redirect_to "/"
  end
end