Created
January 23, 2013 20:50
-
-
Save reinh/4613004 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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