Module: AuthClient::User
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #activity_notify ⇒ Object
- #after_signed_in ⇒ Object
- #app_name ⇒ Object
- #check_app_name ⇒ Object
- #fullname ⇒ Object
- #info_hash ⇒ Object
- #info_notify ⇒ Object
- #last_activity_at ⇒ Object
- #permissions_info ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#activity_notify ⇒ Object
27 28 29 30 31 |
# File 'lib/auth_client/user.rb', line 27 def activity_notify check_app_name RedisUserConnector.set id, "#{app_name}_last_activity", Time.zone.now.to_i end |
#after_signed_in ⇒ Object
47 48 49 |
# File 'lib/auth_client/user.rb', line 47 def after_signed_in info_notify end |
#app_name ⇒ Object
20 21 |
# File 'lib/auth_client/user.rb', line 20 def app_name end |
#check_app_name ⇒ Object
23 24 25 |
# File 'lib/auth_client/user.rb', line 23 def check_app_name raise 'User#app_name should not be blank' if app_name.blank? end |
#fullname ⇒ Object
16 17 18 |
# File 'lib/auth_client/user.rb', line 16 def fullname to_s end |
#info_hash ⇒ Object
39 40 41 |
# File 'lib/auth_client/user.rb', line 39 def info_hash { :permissions => , :url => "https://#{app_name}.tusur.ru/" } end |
#info_notify ⇒ Object
33 34 35 36 37 |
# File 'lib/auth_client/user.rb', line 33 def info_notify check_app_name RedisUserConnector.set id, "#{app_name}_info", info_hash.to_json end |
#last_activity_at ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/auth_client/user.rb', line 51 def last_activity_at return nil if app_name.blank? seconds = instance_variable_get("@#{app_name}_last_activity").to_i Time.at(seconds) end |
#permissions_info ⇒ Object
43 44 45 |
# File 'lib/auth_client/user.rb', line 43 def .map { |p| { :role => p.role, :info => p.context.try(:to_s) }} end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/auth_client/user.rb', line 12 def to_s [surname, name, patronymic].compact.join(' ') end |