Class: RSimpy::User

Inherits:
Object
  • Object
show all
Defined in:
lib/user.rb

Overview

The RSimpy::User class encapsulates user information.

You can instanciate it with a hash containing login and password

For example:

user = RSimpy::User.new 'login', 'password'

Instance Method Summary collapse

Constructor Details

#initialize(login, pass) ⇒ User

Returns a new instance of User.



18
19
20
21
# File 'lib/user.rb', line 18

def initialize , pass
  @login = 
  @pass = pass
end

Instance Method Details

#credentialsObject



23
24
25
# File 'lib/user.rb', line 23

def credentials
  [@login, @pass]
end

#valid?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/user.rb', line 27

def valid?
  @login && @pass
end