Class: CanTango::Config::Guest
- Inherits:
-
Object
- Object
- CanTango::Config::Guest
- Includes:
- Singleton
- Defined in:
- lib/cantango/config/guest.rb
Instance Method Summary collapse
- #account(acc = nil, &block) ⇒ Object (also: #account=)
- #clear! ⇒ Object
- #default_account? ⇒ Boolean
- #default_user? ⇒ Boolean
- #user(user = nil, &block) ⇒ Object (also: #user=)
Instance Method Details
#account(acc = nil, &block) ⇒ Object Also known as: account=
18 19 20 21 |
# File 'lib/cantango/config/guest.rb', line 18 def account acc = nil, &block return (@account || acc) if !acc && !block @account = acc || yield end |
#clear! ⇒ Object
6 7 8 9 |
# File 'lib/cantango/config/guest.rb', line 6 def clear! @user = nil @account = nil end |
#default_account? ⇒ Boolean
28 29 30 |
# File 'lib/cantango/config/guest.rb', line 28 def default_account? has_guest? base_account_class end |
#default_user? ⇒ Boolean
24 25 26 |
# File 'lib/cantango/config/guest.rb', line 24 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/config/guest.rb', line 11 def user user = nil, &block return (@user || guest_user) if !user && !block @user = user || yield end |