Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/auth_client/user.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ User
constructor
A new instance of User.
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ User
10 11 12 13 14 15 |
# File 'lib/auth_client/user.rb', line 10 def initialize() .each_pair do |key, val| self.class_eval("def #{key}; @#{key}; end") self.instance_variable_set "@#{key}", val end end |
Class Method Details
.find_by(id: nil) ⇒ Object
4 5 6 7 8 |
# File 'lib/auth_client/user.rb', line 4 def self.find_by(id: nil) return nil unless id new RedisUserConnector.get(id).merge('id' => id) end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/auth_client/user.rb', line 17 def to_s [surname, name, patronymic].compact.join(' ') end |