# Understanding LoginEngine: class methods?

**URL:** <https://www.ruby-forum.com/t/understanding-loginengine-class-methods/66046>\
**Category:** Engines Development\
**Created:** [August 23, 2006, 12:36am UTC](https://www.ruby-forum.com/t/understanding-loginengine-class-methods/66046 "2006-08-23T00:36:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay-levitt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@jay-levitt](https://www.ruby-forum.com/u/jay-levitt)\
**Post date:** [August 23, 2006, 12:36am UTC](https://www.ruby-forum.com/t/understanding-loginengine-class-methods/66046/1 "2006-08-23T00:36:07Z")

</div>

So I’m working on my differently-opinionated version of LoginEngine, and  
I’ve come across something I don’t quite get.

LoginEngine declares two public class methods (authenticate and  
authenticate\_by\_token) on module ClassMethods, which then get mixed into  
class User via AuthenticatedUser. However, the protected methods that  
they  
rely - ahshed and salted\_password - on aren’t similarly brought into  
User;  
they’re kept in AuthenticatedUser, and called explicitly.

Is there any reason they shouldn’t be mixed into User like the public  
ClassMethods are? Was it just an implementation choice? I haven’t  
played  
much with access control in Ruby, so maybe there’s something I’m  
missing.

Jay L.
