On Sun, Mar 16, 2014 at 5:00 AM, Arup Rakshit <lists / ruby-forum.com> wrote:

> class EncryptDecrypt

The class name itself says "violation of the Single Responsibility
Principle". And why would you expect something with that name to
return a "user" ???

> user1 = EncryptDecrypt.new('arup','xxy')

Leaving aside the obvious refactorings of the insides (methods too
long, etc.), I would call this something like a Credential using two
separate classes (Encrypt and Decrypt, though I would probably
also name them as "things" rather than actions, e.g. Encryptor).

credential = Credential.new('arup','xxy')
credential.match?('arup','xxy') # => true

and so on.

Googling 'ruby and oop' will find you lots of material to ponder :-)

HTH,
-- 
Hassan Schroeder ------------------------ hassan.schroeder / gmail.com
http://about.me/hassanschroeder
twitter: @hassan