Class: Gitlab::Auth::KeyStatusChecker
- Inherits:
-
Object
- Object
- Gitlab::Auth::KeyStatusChecker
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/auth/key_status_checker.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #console_message ⇒ Object
-
#initialize(key) ⇒ KeyStatusChecker
constructor
A new instance of KeyStatusChecker.
- #show_console_message? ⇒ Boolean
Constructor Details
#initialize(key) ⇒ KeyStatusChecker
Returns a new instance of KeyStatusChecker.
10 11 12 |
# File 'lib/gitlab/auth/key_status_checker.rb', line 10 def initialize(key) @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
8 9 10 |
# File 'lib/gitlab/auth/key_status_checker.rb', line 8 def key @key end |
Instance Method Details
#console_message ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/gitlab/auth/key_status_checker.rb', line 18 def strong_memoize(:console_message) do if key.expired? _('INFO: Your SSH key has expired. Please generate a new key.') elsif key.expires_soon? _('INFO: Your SSH key is expiring soon. Please generate a new key.') end end end |
#show_console_message? ⇒ Boolean
14 15 16 |
# File 'lib/gitlab/auth/key_status_checker.rb', line 14 def .present? end |