Skip to content

Instantly share code, notes, and snippets.

@reinh
Created January 23, 2013 20:50
Show Gist options
  • Select an option

  • Save reinh/4613004 to your computer and use it in GitHub Desktop.

Select an option

Save reinh/4613004 to your computer and use it in GitHub Desktop.
class StatsdLoginNotifier
def initialize(session)
@session=session
@statsd = Statsd.new
end
def authenticate(name, password)
result = @session.authenticate(name, password)
@statsd.count result ? 'login.success' : 'login.failure'
return result
end
end
class SessionsController < ApplicationController
def create
StatsdLoginNotifier.new(Session).authenticate params[:name], params[:password]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment