Module: Card::Auth::Setup
- Included in:
- Card::Auth
- Defined in:
- lib/card/auth/setup.rb
Overview
singleton methods for managing setup state
Constant Summary collapse
- SETUP_COMPLETED_KEY =
"SETUP_COMPLETED".freeze
Instance Method Summary collapse
-
#needs_setup? ⇒ true/false
app is not totally set up yet.
-
#simulate_setup_need!(mode = true) ⇒ Object
act as if site is not set up.
Instance Method Details
#needs_setup? ⇒ true/false
app is not totally set up yet
10 11 12 13 14 15 16 |
# File 'lib/card/auth/setup.rb', line 10 def needs_setup? @simulating_setup_need || ( !Card.cache.read(SETUP_COMPLETED_KEY) && !Card.cache.write(SETUP_COMPLETED_KEY, account_count > 2) ) # every deck starts with two accounts: WagnBot and Anonymous end |
#simulate_setup_need!(mode = true) ⇒ Object
act as if site is not set up
20 21 22 |
# File 'lib/card/auth/setup.rb', line 20 def simulate_setup_need! mode=true @simulating_setup_need = mode end |