Class: CanTango::Configuration::Guest

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

Instance Method Summary collapse

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   = nil, &block
  return (@account || ) if ! && !block
  @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

Returns:

  • (Boolean)


29
30
31
# File 'lib/cantango/configuration/guest.rb', line 29

def default_account?
  has_guest? 
end

#default_user?Boolean

Returns:

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