Class: CanTango::Configuration::Guest
- Inherits:
-
Object
- Object
- CanTango::Configuration::Guest
- Includes:
- Singleton
- Defined in:
- lib/cantango/configuration/guest.rb
Instance Method Summary collapse
- #account(account = nil, &block) ⇒ Object (also: #user_account, #account=)
- #clear! ⇒ Object
- #default_account? ⇒ Boolean
- #default_user? ⇒ Boolean
- #user(user = nil, &block) ⇒ Object (also: #user=)
Instance Method Details
#account(account = nil, &block) ⇒ Object Also known as: user_account, account=
18 19 20 21 |
# File 'lib/cantango/configuration/guest.rb', line 18 def account account = nil, &block return (@account || guest_account) if !account && !block @account = account || yield end |
#clear! ⇒ Object
6 7 8 9 |
# File 'lib/cantango/configuration/guest.rb', line 6 def clear! @user = nil @account = nil end |
#default_account? ⇒ Boolean
29 30 31 |
# File 'lib/cantango/configuration/guest.rb', line 29 def default_account? has_guest? base_account_class end |
#default_user? ⇒ Boolean
25 26 27 |
# File 'lib/cantango/configuration/guest.rb', line 25 def default_user? has_guest? base_user_class end |
#user(user = nil, &block) ⇒ Object Also known as: user=
11 12 13 14 |
# File 'lib/cantango/configuration/guest.rb', line 11 def user user = nil, &block return (@user || guest_user) if !user && !block @user = user || yield end |