Class: CanTango::Config::Guest

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/cantango/config/guest.rb

Instance Method Summary collapse

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  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

Returns:

  • (Boolean)


28
29
30
# File 'lib/cantango/config/guest.rb', line 28

def default_account?
  has_guest? 
end

#default_user?Boolean

Returns:

  • (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