Class: Users::SupportPin::BaseService
- Inherits:
-
Object
- Object
- Users::SupportPin::BaseService
show all
- Defined in:
- app/services/users/support_pin/base_service.rb
Constant Summary
collapse
- SUPPORT_PIN_PREFIX =
"support_pin"
- SUPPORT_PIN_EXPIRATION =
7.days.from_now
Instance Method Summary
collapse
Constructor Details
Returns a new instance of BaseService.
9
10
11
|
# File 'app/services/users/support_pin/base_service.rb', line 9
def initialize(user)
@user = user
end
|
Instance Method Details
#pin_exists? ⇒ Boolean
17
18
19
20
21
|
# File 'app/services/users/support_pin/base_service.rb', line 17
def pin_exists?
Gitlab::Redis::Cache.with do |redis|
redis.exists(pin_key).to_i > 0
end
end
|
#pin_key ⇒ Object
13
14
15
|
# File 'app/services/users/support_pin/base_service.rb', line 13
def pin_key
"#{SUPPORT_PIN_PREFIX}:#{@user.id}"
end
|